AI-generated Key Takeaways
-
ExcludedVideoAgeSelector fetches excluded video ages and supports filtering and sorting.
-
The
get()method returns an iterator to access the requested excluded video ages. -
You can use
orderBy()to specify the sorting order of the results based on various columns. -
The
withCondition()method allows you to narrow down the results by adding specific conditions. -
withLimit()can be used to limit the number of entities returned by the selector.
Typical usage:
var excludedVideoAgeSelector = AdsApp.videoTargeting() .excludedVideoAges() .withCondition("ad_group.status = 'ENABLED'") .orderBy("ad_group.name DESC"); var excludedVideoAgeIterator = excludedVideoAgeSelector.get(); while (excludedVideoAgeIterator.hasNext()) { var excludedVideoAge = excludedVideoAgeIterator.next(); }
Methods:
| Member | Type | Description |
|---|---|---|
| get() | AdsApp.ExcludedVideoAgeIterator |
Fetches the requested excluded video ages and returns an iterator. |
| orderBy(orderBy) | AdsApp.ExcludedVideoAgeSelector |
Specifies the ordering of the resulting entities. |
| withCondition(condition) | AdsApp.ExcludedVideoAgeSelector |
Adds the specified condition to the selector in order to narrow down the results. |
| withLimit(limit) | AdsApp.ExcludedVideoAgeSelector |
Specifies limit for the selector to use. |
get()
Fetches the requested excluded video ages and returns an iterator. Return values:
| Type | Description |
|---|---|
AdsApp.ExcludedVideoAgeIterator |
Iterator of the requested excluded video ages. |
orderBy(orderBy)
Specifies the ordering of the resulting entities. orderBy
parameter can have one of the following forms:
orderBy("ad_group.name")- orders results by ad_group.name, in ascending order.orderBy("ad_group.name ASC")- orders results by ad_group.name, in ascending order.orderBy("ad_group.name DESC")- orders results by ad_group.name, in descending order.
See ExcludedVideoAgeSelector.withCondition(String) for enumeration of columns that can be used.
orderBy() may be called multiple times. Consider the
following example:
selector = selector.
.orderBy("ad_group.name")
.orderBy("campaign.name");The results will be ordered by ad_group.name in ascending order. Results with equal ad_group.name value will be ordered by campaign.name in ascending order.
Arguments:
| Name | Type | Description |
|---|---|---|
| orderBy | String |
Ordering to apply. |
Return values:
| Type | Description |
|---|---|
AdsApp.ExcludedVideoAgeSelector |
The selector with ordering applied. |
withCondition(condition)
Adds the specified condition to the selector in order to narrow down the
results.
Multiple conditions may be added to the same selector:
selector = selector .withCondition("ad_group.status NOT IN [PAUSED]") .withCondition("campaign.name = 'Campaign 1'");
AND-ed together. The above
example will retrieve excluded entities in Campaign 1 that are in ad groups
that are not paused.
The parameter to be passed into this method must be of the following form:
"COLUMN_NAME OPERATOR VALUE"
Operators
The operator that can be used in a condition depends on the type of column.- For
Stringcolumns (e.g. ad_group.name):= != (NOT) (LIKE | CONTAINS | REGEXP_MATCH)
- For
Enumerationcolumns (ones that can only take one value from a pre-defined list, such as ad_group.status):= != IN () NOT IN ()
IN, NOT IN, CONTAINS
ALL, CONTAINS ANY and CONTAINS NONE
operators look as follows:
withCondition("ad_group.status IN [ENABLED, PAUSED]")Columns
All column names are case-sensitive, and so are all values of enumerated columns (such as ad_group.status)
| Column | Type | Example |
|---|---|---|
| AgeRangeType |
Enumeration: AGE_RANGE_18_24,
AGE_RANGE_25_34, AGE_RANGE_35_44,
AGE_RANGE_45_54, AGE_RANGE_55_64,
AGE_RANGE_65_UP, AGE_RANGE_UNDETERMINED
|
withCondition("AgeRangeType IN ['AGE_RANGE_18_24', 'AGE_RANGE_25_34']") |
| ad_group.name | String | withCondition("ad_group.name REGEXP_MATCH '.*shoes.*'") |
| ad_group.status |
Enumeration: ENABLED, PAUSED,
REMOVED
|
withCondition("ad_group.status = ENABLED"). Use to fetch
excluded topics from only ENABLED ad groups.
|
| campaign.name | String | withCondition("campaign.name REGEXP_MATCH '.*promotion.*'") |
| campaign.status |
Enumeration: ENABLED, PAUSED,
REMOVED
|
withCondition("campaign.status = ENABLED"). Use to fetch
excluded topics from only ENABLED campaigns.
|
Arguments:
| Name | Type | Description |
|---|---|---|
| condition | String |
Condition to add to the selector. |
Return values:
| Type | Description |
|---|---|
AdsApp.ExcludedVideoAgeSelector |
The selector with the condition applied. |
withLimit(limit)
Specifies limit for the selector to use. For instance,
withLimit(50) returns only the first 50 entities. Arguments:
| Name | Type | Description |
|---|---|---|
| limit | int |
How many entities to return. |
Return values:
| Type | Description |
|---|---|
AdsApp.ExcludedVideoAgeSelector |
The selector with limit applied. |