AdsApp.​CampaignExtensions

  • This page focuses on how to access campaign-level extensions within Google Ads scripts.

  • The provided code snippet demonstrates how to iterate through and access all sitelinks associated with a specific campaign.

  • A table outlines various methods to retrieve selectors for different campaign extension types, including callouts, mobile apps, phone numbers, prices, sitelinks, and snippets.

  • Each method returns a specific selector object, allowing you to further manipulate and access the respective extensions.

  • This information is crucial for developers aiming to automate campaign extension management or perform analysis at the campaign level.

Access to campaign-level extensions.

For example, to access all sitelinks belonging to a campaign:

var campaignSitelinkIterator = campaign.extensions().sitelinks().get();
while (campaignSitelinkIterator.hasNext()) {
  var campaignSitelink = campaignSitelinkIterator.next();
}

Methods:

MemberTypeDescription
callouts() AdsApp.CampaignCalloutSelector Returns the selector of all callouts in the campaign.
mobileApps() AdsApp.CampaignMobileAppSelector Returns the selector of all mobile apps in the campaign.
phoneNumbers() AdsApp.CampaignPhoneNumberSelector Returns the selector of all phone numbers in the campaign.
prices() AdsApp.CampaignPriceSelector Returns the selector of all prices in the campaign.
sitelinks() AdsApp.CampaignSitelinkSelector Returns the selector of all sitelinks in the campaign.
snippets() AdsApp.CampaignSnippetSelector Returns the selector of all snippets in the campaign.

callouts()

Returns the selector of all callouts in the campaign.

Return values:

TypeDescription
AdsApp.CampaignCalloutSelector The selector of all callouts in the campaign.

mobileApps()

Returns the selector of all mobile apps in the campaign.

Return values:

TypeDescription
AdsApp.CampaignMobileAppSelector The selector of all mobile apps in the campaign.

phoneNumbers()

Returns the selector of all phone numbers in the campaign.

Return values:

TypeDescription
AdsApp.CampaignPhoneNumberSelector The selector of all phone numbers in the campaign.

prices()

Returns the selector of all prices in the campaign.

Return values:

TypeDescription
AdsApp.CampaignPriceSelector The selector of all prices in the campaign.
Returns the selector of all sitelinks in the campaign.

Return values:

TypeDescription
AdsApp.CampaignSitelinkSelector The selector of all sitelinks in the campaign.

snippets()

Returns the selector of all snippets in the campaign.

Return values:

TypeDescription
AdsApp.CampaignSnippetSelector The selector of all snippets in the campaign.