AdWordsApp.​UserListSelector

Methods:

MemberTypeDescription
get AdWordsApp.UserListIterator Fetches the requested user lists and returns an iterator.
orderBy AdWordsApp.UserListSelector Specifies the ordering of the resulting entities.
withCondition AdWordsApp.UserListSelector Adds the specified condition to the selector in order to narrow down the results.
withIds AdWordsApp.UserListSelector Restricts this selector to return only user lists with the given user list IDs.
withLimit AdWordsApp.UserListSelector Specifies limit for the selector to use.

get()

Fetches the requested user lists and returns an iterator.

Return values:

TypeDescription
AdWordsApp.UserListIterator Iterator of the requested user lists.

orderBy(orderBy)

Specifies the ordering of the resulting entities. orderBy parameter can have one of the following forms:
  • orderBy("MembershipLifeSpan") - orders results by MembershipLifeSpan, in ascending order.
  • orderBy("SizeForSearch ASC") - orders results by SizeForSearch, in ascending order.
  • orderBy("Name DESC") - orders results by Name, in descending order.

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

orderBy() may be called multiple times. Consider the following example:

 selector = selector.orderBy("Name ASC").orderBy("MembershipLifeSpan DESC");

The results will be ordered by Name in ascending order. Results with equal Name values will be ordered by MembershipLifeSpan in descending order.

Arguments:

NameTypeDescription
orderBy String Ordering to apply.

Return values:

TypeDescription
AdWordsApp.UserListSelector 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("MembershipLifeSpan > 30").withCondition(
 "SizeForSearch > 1000");
All specified conditions are AND-ed together. The above example will retrieve entities with a membership life span of more then 30 days and 100 members eligible for search campaigns/ad groups.

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. SizeForDisplay, SizeForSearch):
    <  <=  >  >=  =  !=
  • For String columns (e.g. Name):
    =  !=  STARTS_WITH  STARTS_WITH_IGNORE_CASE  CONTAINS
     CONTAINS_IGNORE_CASE  DOES_NOT_CONTAIN  DOES_NOT_CONTAIN_IGNORE_CASE
  • For Enumeration columns (ones that can only take one value from a predefined list, such as Status):
    =  !=  IN []  NOT_IN []
Conditions using IN, NOT_IN, CONTAINS_ALL, CONTAINS_ANY and CONTAINS_NONE operators look as follows:
 withCondition("ColumnName IN [Value1, Value2]")
Operators are case-sensitive: starts_with won't work.

Columns

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

Column Type Example
User list attributes
Id Long withCondition("Id = 123456789").
Name String withCondition("Name CONTAINS_IGNORE_CASE 'visitor'")
Description String withCondition("Description = 'Description of a user list'")
Type Enumeration: UNKNOWN, REMARKETING, LOGICAL, EXTERNAL_REMARKETING, RULE_BASED, SIMILAR, CRM_BASED withCondition("Type = CRM_BASED")
IsOpen Boolean withCondition("IsOpen = true")
IsClosed Boolean withCondition("IsClosed = true")
MembershipLifeSpan Long withCondition("MembershipLifeSpan > 30")
SizeForDisplay Long withCondition("SizeForDisplay < 5000")
SizeRangeForDisplay Enumeration: LESS_THAN_FIVE_HUNDRED, LESS_THAN_ONE_THOUSAND, ONE_THOUSAND_TO_TEN_THOUSAND, TEN_THOUSAND_TO_FIFTY_THOUSAND, FIFTY_THOUSAND_TO_ONE_HUNDRED_THOUSAND, ONE_HUNDRED_THOUSAND_TO_THREE_HUNDRED_THOUSAND, THREE_HUNDRED_THOUSAND_TO_FIVE_HUNDRED_THOUSAND, FIVE_HUNDRED_THOUSAND_TO_ONE_MILLION, ONE_MILLION_TO_TWO_MILLION, TWO_MILLION_TO_THREE_MILLION, THREE_MILLION_TO_FIVE_MILLION, FIVE_MILLION_TO_TEN_MILLION, TEN_MILLION_TO_TWENTY_MILLION, TWENTY_MILLION_TO_THIRTY_MILLION, THIRTY_MILLION_TO_FIFTY_MILLION, OVER_FIFTY_MILLION withCondition("SizeRangeForDisplay = FIFTY_THOUSAND_TO_ONE_HUNDRED_THOUSAND")
SizeForSearch Long withCondition("SizeForSearch < 5000")
SizeRangeForSearch Enumeration: LESS_THAN_FIVE_HUNDRED, LESS_THAN_ONE_THOUSAND, ONE_THOUSAND_TO_TEN_THOUSAND, TEN_THOUSAND_TO_FIFTY_THOUSAND, FIFTY_THOUSAND_TO_ONE_HUNDRED_THOUSAND, ONE_HUNDRED_THOUSAND_TO_THREE_HUNDRED_THOUSAND, THREE_HUNDRED_THOUSAND_TO_FIVE_HUNDRED_THOUSAND, FIVE_HUNDRED_THOUSAND_TO_ONE_MILLION, ONE_MILLION_TO_TWO_MILLION, TWO_MILLION_TO_THREE_MILLION, THREE_MILLION_TO_FIVE_MILLION, FIVE_MILLION_TO_TEN_MILLION, TEN_MILLION_TO_TWENTY_MILLION, TWENTY_MILLION_TO_THIRTY_MILLION, THIRTY_MILLION_TO_FIFTY_MILLION, OVER_FIFTY_MILLION withCondition("SizeRangeForSearch = FIFTY_THOUSAND_TO_ONE_HUNDRED_THOUSAND")
IsReadOnly Boolean withCondition("IsReadOnly = true")
IsEligibleForDisplay Boolean withCondition("IsEligibleForDisplay = true")
IsEligibleForSearch Boolean withCondition("IsEligibleForSearch = true")

Arguments:

NameTypeDescription
condition String Condition to add to the selector.

Return values:

TypeDescription
AdWordsApp.UserListSelector The selector with the condition applied.

withIds(ids)

Restricts this selector to return only user lists with the given user list IDs.
 var userListIds = [12345, 23456, 34567];
 selector = selector.withIds(userListIds);

The resulting selector can be further refined by applying additional conditions to it. The ID-based condition will then be AND-ed together with all the other conditions, including any other ID-based conditions. So, for instance, the following selector:

 AdWordsApp.userLists().userLists()
    .withIds([12345, 23456, 34567])
    .withIds([34567, 45678, 56789]);
will only get the user list with ID 34567, since it would be the only user list that satisfies both ID conditions.

The selector can only support up to 10,000 IDs. If more than 10,000 IDs are specified, the corresponding get() call will fail with a runtime error.

Arguments:

NameTypeDescription
ids long[] Array of user list IDs.

Return values:

TypeDescription
AdWordsApp.UserListSelector The selector restricted to the given IDs.

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
AdWordsApp.UserListSelector The selector with limit applied.

Оставить отзыв о...

Текущей странице
AdWords Scripts
AdWords Scripts
Нужна помощь? Обратитесь в службу поддержки.