AdsApp.​ShoppingCampaignTargeting

Access to campaign-level targeting criteria.

For instance, to select all locations targeted by a campaign you might use:

var campaign = AdsApp.shoppingCampaigns().get().next();
var locations = campaign.targeting().targetedLocations().get();
while (locations.hasNext()) {
  var location = locations.next();
}

Methods:

MemberTypeDescription
adSchedulesAdsApp.AdScheduleSelectorSpecializes this selector to return AdSchedule criteria.
audiencesAdsApp.ShoppingCampaignAudienceSelectorSpecializes this selector to return ShoppingCampaignAudience criteria.
excludedLocationsAdsApp.ExcludedLocationSelectorSpecializes this selector to return ExcludedLocation criteria.
getTargetingSettingStringReturns the current targeting setting of the specified criterion type group for this campaign.
newUserListBuilderAdsApp.ShoppingCampaignAudienceBuilderReturns a new user list audience builder for this campaign.
platformsAdsApp.PlatformSelectorSpecializes this selector to return Platform criteria.
setTargetingSettingvoidSets the targeting setting for this campaign.
targetedLocationsAdsApp.TargetedLocationSelectorSpecializes this selector to return TargetedLocation criteria.
targetedProximitiesAdsApp.TargetedProximitySelectorSpecializes this selector to return TargetedProximity criteria.

adSchedules()

Specializes this selector to return AdSchedule criteria.

Return values:

TypeDescription
AdsApp.AdScheduleSelectorA selector for AdSchedule criteria.

audiences()

Specializes this selector to return ShoppingCampaignAudience criteria.

Return values:

TypeDescription
AdsApp.ShoppingCampaignAudienceSelectorA selector for ShoppingCampaignAudience criteria.

excludedLocations()

Specializes this selector to return ExcludedLocation criteria.

Return values:

TypeDescription
AdsApp.ExcludedLocationSelectorA selector for ExcludedLocation criteria.

getTargetingSetting(criterionTypeGroup)

Returns the current targeting setting of the specified criterion type group for this campaign.

Currently the only supported criterion type group value is 'USER_INTEREST_AND_LIST'.

The returned setting will be either 'TARGET_ALL_TRUE' or 'TARGET_ALL_FALSE', corresponding to 'Bid only' and 'Target and bid', respectively.

Arguments:

NameTypeDescription
criterionTypeGroupStringThe criterion type group to check.

Return values:

TypeDescription
StringThe targeting setting for the criterion type group, either 'TARGET_ALL_TRUE' or 'TARGET_ALL_FALSE'.

newUserListBuilder()

Returns a new user list audience builder for this campaign. When ShoppingCampaignAudienceBuilder.build() is called, an audience will be added in this campaign.

Return values:

TypeDescription
AdsApp.ShoppingCampaignAudienceBuilderThe builder used to add an audience in the campaign.

platforms()

Specializes this selector to return Platform criteria.

Return values:

TypeDescription
AdsApp.PlatformSelectorA selector for Platform criteria.

setTargetingSetting(criterionTypeGroup, targetingSetting)

Sets the targeting setting for this campaign.

Currently the targeting setting may be set for USER_INTEREST_AND_LIST criterion type group only.

Returns nothing.

Arguments:

NameTypeDescription
criterionTypeGroupStringThe criterion type group to receive the new setting.
targetingSettingStringThe new targeting setting, either 'TARGET_ALL_TRUE' or 'TARGET_ALL_FALSE'.

targetedLocations()

Specializes this selector to return TargetedLocation criteria.

Return values:

TypeDescription
AdsApp.TargetedLocationSelectorA selector for TargetedLocation criteria.

targetedProximities()

Specializes this selector to return TargetedProximity criteria.

Return values:

TypeDescription
AdsApp.TargetedProximitySelectorA selector for TargetedProximity criteria.