AdsApp.​AdCustomizerSourceSelector

Fetches ad customizer sources. Supports filtering and sorting on the feed resource type.

Typical usage:

const sources = AdsApp.adCustomizerSources()
    .withCondition('feed.name LIKE "%flowers%"');
for (const source of sources) {
  // do something with the ad customizer source
}
Related:

Methods:

MemberTypeDescription
get AdsApp.AdCustomizerSourceIterator Fetches the requested ad customizer sources and returns an iterator.
orderBy AdsApp.AdCustomizerSourceSelector Specifies the ordering of the resulting entities.
withCondition AdsApp.AdCustomizerSourceSelector Adds the specified condition to the selector in order to narrow down the results.
withLimit AdsApp.AdCustomizerSourceSelector Specifies limit for the selector to use.

get()

Fetches the requested ad customizer sources and returns an iterator.

Return values:

TypeDescription
AdsApp.AdCustomizerSourceIterator Iterator of the requested ad customizer sources.

orderBy(orderBy)

Specifies the ordering of the resulting entities. orderBy parameter can have one of the following forms:
  • orderBy('feed.name') - orders results by feed.name, in alphabetic order.
  • orderBy('feed.name ASC') - orders results by feed.name, in alphabetic order.
  • orderBy('feed.name DESC') - orders results by feed.name, in reverse alphabetic order.

See AdCustomizerSourceSelector.withCondition(String) for enumeration of columns that can be used.

Arguments:

NameTypeDescription
orderBy String Ordering to apply.

Return values:

TypeDescription
AdsApp.AdCustomizerSourceSelector 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('feed.name LIKE "%flowers%')
    .withCondition('feed.name LIKE "%customizers%");
All specified conditions are AND-ed together. The above example will retrieve ad customizer sources with both "flowers" and "customizers" in the name.

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 Integer and Long columns (e.g. metrics.clicks and metrics.impressions):
    <  <=  >  >=  =  !=
  • For Double columns (e.g. metrics.ctr):
    <  >
  • For String columns (e.g. campaign.name):
    =  !=  (NOT) (LIKE | CONTAINS | REGEXP_MATCH)
  • For Enumeration columns (ones that can only take one value from a predefined list, such as Status):
    =  !=  IN ()  NOT IN ()
  • For StringSet columns (e.g. campaign.labels):
    CONTAINS ALL ()  CONTAINS ANY ()  CONTAINS NONE ()
Conditions using IN, NOT IN, CONTAINS ALL, CONTAINS ANY and CONTAINS NONE operators look as follows:
withCondition("resource.column_name IN (Value1, Value2)")

Columns

All column names are case-sensitive, and so are all values of enumerated columns (such as Status).

Column Type Example
feed.name String withCondition('feed.name LIKE "%flowers%"')
feed.id Long withCondition('feed.id IN (1000, 2000, 3000)')

Arguments:

NameTypeDescription
condition String Condition to add to the selector.

Return values:

TypeDescription
AdsApp.AdCustomizerSourceSelector 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:

NameTypeDescription
limit int How many entities to return.

Return values:

TypeDescription
AdsApp.AdCustomizerSourceSelector The selector with limit applied.