This is the legacy documentation for Google Ads scripts. Go to the current docs.

AdsApp.​ExcludedContentLabelSelector

Stay organized with collections Save and categorize content based on your preferences.
Fetches excluded content labels. Supports filtering and sorting.

Typical usage:

 var excludedContentLabelSelector = campaign.targeting()
     .excludedContentLabels()
     .withCondition("Impressions > 100")
     .orderBy("Clicks DESC");

 var excludedContentLabelIterator = excludedContentLabelSelector.get();
 while (excludedContentLabelIterator.hasNext()) {
   var excludedContentLabel = excludedContentLabelIterator.next();
 }
Related:

Methods:

MemberTypeDescription
get AdsApp.ExcludedContentLabelIterator Fetches the requested excluded content labels and returns an iterator.
withIds AdsApp.ExcludedContentLabelSelector Restricts this selector to return only excluded content labels with the given excluded content label IDs.
withLimit AdsApp.ExcludedContentLabelSelector Specifies limit for the selector to use.

get()

Fetches the requested excluded content labels and returns an iterator.

Return values:

TypeDescription
AdsApp.ExcludedContentLabelIterator Iterator of the requested excluded content labels.

withIds(ids)

Restricts this selector to return only excluded content labels with the given excluded content label IDs.

All excluded content labels are uniquely identified by the combination of their ad group ID and excluded content label ID. The IDs for this selector are thus represented as two-element arrays, with the first element being the ad group ID and the second being the excluded content label ID:

 var excludedContentLabelIds = [
   [12345, 987987],
   [23456, 876876],
   [34567, 765765],
 ];
 selector = selector.withIds(excludedContentLabelIds);

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:

 var ids1 = [
   [12345, 987987],
   [23456, 876876],
   [34567, 765765],
 ];
 var ids2 = [
   [34567, 765765],
   [45678, 654654],
   [56789, 543543],
 ];
 AdsApp.targeting().excludedContentLabels()
    .withIds(ids1)
    .withIds(ids2);
will only get the excluded content label with ID [34567, 765765], since it would be the only excluded content label that satisfies both ID conditions.

Arguments:

NameTypeDescription
ids long[][] Array of excluded content label IDs.

Return values:

TypeDescription
AdsApp.ExcludedContentLabelSelector 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
AdsApp.ExcludedContentLabelSelector The selector with limit applied.