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
adSchedules AdsApp.ShoppingAdScheduleSelector Specializes this selector to return ShoppingAdSchedule criteria.
audiences AdsApp.ShoppingCampaignAudienceSelector Specializes this selector to return ShoppingCampaignAudience criteria.
excludedLocations AdsApp.ShoppingExcludedLocationSelector Specializes this selector to return ShoppingExcludedLocation criteria.
getTargetingSetting String Returns the current targeting setting of the specified criterion type group for this campaign.
newUserListBuilder AdsApp.ShoppingCampaignAudienceBuilder Returns a new user list audience builder for this campaign.
platforms AdsApp.ShoppingPlatformSelector Specializes this selector to return ShoppingPlatform criteria.
setTargetingSetting void Sets the targeting setting for this campaign.
targetedLocations AdsApp.ShoppingTargetedLocationSelector Specializes this selector to return TargetedLocation criteria.
targetedProximities AdsApp.ShoppingTargetedProximitySelector Specializes this selector to return ShoppingTargetedProximity criteria.

adSchedules()

Specializes this selector to return ShoppingAdSchedule criteria.

Return values:

TypeDescription
AdsApp.ShoppingAdScheduleSelector A selector for ShoppingAdSchedule criteria.

audiences()

Specializes this selector to return ShoppingCampaignAudience criteria.

Return values:

TypeDescription
AdsApp.ShoppingCampaignAudienceSelector A selector for ShoppingCampaignAudience criteria.

excludedLocations()

Specializes this selector to return ShoppingExcludedLocation criteria.

Return values:

TypeDescription
AdsApp.ShoppingExcludedLocationSelector A selector for ShoppingExcludedLocation 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.

For more information about criterion type groups, please see the Google Ads Reference article.

Arguments:

NameTypeDescription
criterionTypeGroup String The criterion type group to check.

Return values:

TypeDescription
String The 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.ShoppingCampaignAudienceBuilder The builder used to add an audience in the campaign.

platforms()

Specializes this selector to return ShoppingPlatform criteria.

Return values:

TypeDescription
AdsApp.ShoppingPlatformSelector A selector for ShoppingPlatform criteria.

setTargetingSetting(criterionTypeGroup, targetingSetting)

Sets the targeting setting for this campaign.

For more information about criterion type groups, please see the Google Ads Reference article.

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

Returns nothing.

Arguments:

NameTypeDescription
criterionTypeGroup String The criterion type group to receive the new setting.
targetingSetting String The new targeting setting, either 'TARGET_ALL_TRUE' or 'TARGET_ALL_FALSE'.

targetedLocations()

Specializes this selector to return TargetedLocation criteria.

Return values:

TypeDescription
AdsApp.ShoppingTargetedLocationSelector A selector for ShoppingTargetedLocation criteria.

targetedProximities()

Specializes this selector to return ShoppingTargetedProximity criteria.

Return values:

TypeDescription
AdsApp.ShoppingTargetedProximitySelector A selector for ShoppingTargetedProximity criteria.

发送以下问题的反馈:

此网页
Google Ads scripts
Google Ads scripts
需要帮助?请访问我们的支持页面