Methods:
Member | Type | Description |
---|---|---|
AdsApp.AdParamSelector
|
Creates a selector of all ad params in the ad group. | |
AdsApp.CalloutOperation
|
Adds a callout to this ad group. | |
AdsApp.MobileAppOperation
|
Adds a mobile app to this ad group. | |
AdsApp.PhoneNumberOperation
|
Adds a phone number to this ad group. | |
AdsApp.PriceOperation
|
Adds a price extension to this ad group. | |
AdsApp.SitelinkOperation
|
Adds a sitelink to this ad group. | |
AdsApp.SnippetOperation
|
Adds a snippet to this ad group. | |
AdsApp.AdSelector
|
Returns the selector of all ads in the ad group. | |
void
|
Applies a label to the ad group. | |
AdsApp.AdGroupBidding
|
Provides access to this ad group's bidding fields. | |
void
|
Clears the mobile bid modifier for this ad group. | |
void
|
Creates a new negative keyword with the specified text. | |
AdsApp.AdGroupDevices
|
Returns an AdGroupDevices instance associated with the ad group. | |
AdsApp.AdGroupDisplay
|
Provides access to this ad group's display criteria: Audience , ExcludedAudience , DisplayKeyword , ExcludedDisplayKeyword , Placement , ExcludedPlacement , Topic , and ExcludedTopic . | |
void
|
Enables the ad group. | |
AdsApp.AdGroupExtensions
|
Provides access to this ad group's extensions: AdGroupCallout , AdGroupMobileApp , AdGroupPhoneNumber , AdGroupSitelink , and AdGroupSnippet . | |
AdsApp.AdGroup
|
Returns the base ad group to which this ad group belongs. | |
AdsApp.Campaign
|
Returns the base campaign to which this ad group belongs. | |
AdsApp.Campaign
|
Returns the campaign to which this ad group belongs or null
if it does not belong to a search or display campaign. |
|
String
|
Returns the type of this entity as a String
, in this case, "AdGroup"
. |
|
String
|
Returns the ID of the ad group. | |
double
|
Returns the mobile bid modifier for this ad group. | |
String
|
Returns the name of the ad group. | |
String
|
Returns the resource name of the ad group. | |
AdsApp.Stats
|
Returns stats for the specified date range. | |
AdsApp.Stats
|
Returns stats for the specified custom date range. | |
boolean
|
Returns true
if the ad group is enabled. |
|
boolean
|
Returns true
if the ad group is paused. |
|
boolean
|
Returns true
if the ad group is removed. |
|
AdsApp.KeywordSelector
|
Returns the selector of all keywords in the ad group. | |
AdsApp.LabelSelector
|
Creates a selector of all labels applied to the ad group. | |
AdsApp.NegativeKeywordSelector
|
Returns a selector of all negative keywords in the ad group. | |
AdsApp.AdBuilderSpace
|
Returns a new ad builder space associated with this ad group. | |
AdsApp.KeywordBuilder
|
Returns a new keyword builder associated with this ad group. | |
void
|
Pauses the ad group. | |
AdsApp.RecommendationSelector
|
Returns the selector of all recommendations for this ad group. | |
void
|
Removes a callout extension from this ad group. | |
void
|
Removes a label from the ad group. | |
void
|
Removes a mobile app extension from this ad group. | |
void
|
Removes a phone number extension from this ad group. | |
void
|
Removes a price extension from this ad group. | |
void
|
Removes a sitelink extension from this ad group. | |
void
|
Removes a snippet extension from this ad group. | |
void
|
Sets the mobile bid modifier for this ad group to the specified value. | |
void
|
Sets the name of the ad group. | |
AdsApp.AdGroupTargeting
|
Provides access to ad group-level targeting criteria: audiences. | |
AdsApp.AdGroupUrls
|
Provides access to this ad group's URL fields. |
adParams()
Creates a selector of all ad params in the ad group. Return values:
Type | Description |
---|---|
AdsApp.AdParamSelector
|
Selector of all ad params in the ad group. |
addCallout(calloutExtension)
Adds a callout to this ad group. See also Extensions.newCalloutBuilder()
Arguments:
Name | Type | Description |
---|---|---|
calloutExtension
|
AdsApp.Callout
|
The callout to add to this ad group. |
Return values:
Type | Description |
---|---|
AdsApp.CalloutOperation
|
The associated callout operation. |
addMobileApp(mobileAppExtension)
Adds a mobile app to this ad group. See also Extensions.newMobileAppBuilder()
Arguments:
Name | Type | Description |
---|---|---|
mobileAppExtension
|
AdsApp.MobileApp
|
The mobile app to add to this ad group. |
Return values:
Type | Description |
---|---|
AdsApp.MobileAppOperation
|
The associated mobile app operation. |
addPhoneNumber(phoneNumberExtension)
Adds a phone number to this ad group. See also Extensions.newPhoneNumberBuilder()
Arguments:
Name | Type | Description |
---|---|---|
phoneNumberExtension
|
AdsApp.PhoneNumber
|
The phone number to add to this ad group. |
Return values:
Type | Description |
---|---|
AdsApp.PhoneNumberOperation
|
The associated phone number operation. |
addPrice(priceExtension)
Adds a price extension to this ad group. See also Extensions.newPriceBuilder()
. Arguments:
Name | Type | Description |
---|---|---|
priceExtension
|
AdsApp.Price
|
The price to add to this ad group. |
Return values:
Type | Description |
---|---|
AdsApp.PriceOperation
|
The associated price operation. |
addSitelink(sitelinkExtension)
Adds a sitelink to this ad group. See also Extensions.newSitelinkBuilder()
Arguments:
Name | Type | Description |
---|---|---|
sitelinkExtension
|
AdsApp.Sitelink
|
The sitelink to add to this ad group. |
Return values:
Type | Description |
---|---|
AdsApp.SitelinkOperation
|
The associated sitelink operation. |
addSnippet(snippetExtension)
Adds a snippet to this ad group. See also Extensions.newSnippetBuilder()
Arguments:
Name | Type | Description |
---|---|---|
snippetExtension
|
AdsApp.Snippet
|
The snippet to add to this ad group. |
Return values:
Type | Description |
---|---|
AdsApp.SnippetOperation
|
The associated snippet operation. |
ads()
Returns the selector of all ads in the ad group. Return values:
Type | Description |
---|---|
AdsApp.AdSelector
|
The selector of all ads in the ad group. |
applyLabel(name)
Applies a label to the ad group. name
of the label
is case-sensitive. Operation will fail if the label with the specified name
does not already exist in the account. Note that the ad group cannot have more than 50 labels.
Returns nothing.
Arguments:
Name | Type | Description |
---|---|---|
name
|
String
|
Name of the label to apply. |
bidding()
Provides access to this ad group's bidding fields. Return values:
Type | Description |
---|---|
AdsApp.AdGroupBidding
|
Access to this ad group's bidding fields. |
clearMobileBidModifier()
Clears the mobile bid modifier for this ad group. By clearing this value,
the ad group will use its campaign's mobile bid modifier (if one is set). clearMobileBidModifier()
For more information about bid modifiers, please see the Google Ads Help Center article .
Returns nothing.
createNegativeKeyword(keywordText)
Creates a new negative keyword with the specified text. Match type for the new negative keyword is specified as follows:
-
createNegativeKeyword("shoes")
- broad match. -
createNegativeKeyword("\"shoes\"")
- phrase match. -
createNegativeKeyword("[leather shoes]")
- exact match.
Returns nothing.
Arguments:
Name | Type | Description |
---|---|---|
keywordText
|
String
|
The text of the new negative keyword. |
devices()
Returns an AdGroupDevices
instance
associated with the ad group. Return values:
Type | Description |
---|---|
AdsApp.AdGroupDevices
|
An AdGroupDevices instance associated with the ad group. |
display()
Provides access to this ad group's display criteria: Audience
, ExcludedAudience
, DisplayKeyword
, ExcludedDisplayKeyword
, Placement
, ExcludedPlacement
, Topic
, and ExcludedTopic
. Return values:
Type | Description |
---|---|
AdsApp.AdGroupDisplay
|
Access to this ad group's display criteria. |
enable()
Enables the ad group. Returns nothing.
extensions()
Provides access to this ad group's extensions: AdGroupCallout
, AdGroupMobileApp
, AdGroupPhoneNumber
, AdGroupSitelink
, and AdGroupSnippet
. Return values:
Type | Description |
---|---|
AdsApp.AdGroupExtensions
|
Access to this ad group's extensions. |
getBaseAdGroup()
Returns the base ad group to which this ad group belongs. Return values:
Type | Description |
---|---|
AdsApp.AdGroup
|
The base ad group to which this ad group belongs. |
getBaseCampaign()
Returns the base campaign to which this ad group belongs. Return values:
Type | Description |
---|---|
AdsApp.Campaign
|
The base campaign to which this ad group belongs. |
getCampaign()
Returns the campaign to which this ad group belongs or null
if it does not belong to a search or display campaign. Return values:
Type | Description |
---|---|
AdsApp.Campaign
|
The campaign to which this ad group belongs or null
if it does
not belong to a search or display campaign. |
getEntityType()
Returns the type of this entity as a String
, in this case, "AdGroup"
. Return values:
Type | Description |
---|---|
String
|
Type of this entity: "AdGroup"
. |
getId()
Returns the ID of the ad group. Return values:
Type | Description |
---|---|
String
|
The ID of the ad group. |
getMobileBidModifier()
Returns the mobile bid modifier for this ad group. getMobileBidModifier()
The bid modifier is a multiplier applied to the ad group's bids on
mobile devices. So, for instance, a bid modifier of 1.1
increases the bid to 110% of its original value, and changes a bid of $5.00
to $5.50.
Note that when you set a mobile bid modifier at both campaign- and ad group-level in a single campaign, the ad group mobile bid modifier will be used when determining your bid UNLESS the campaign mobile bid modifier is set to -1 (i.e. -100%) which will opt the entire campaign out of mobile regardless of any ad group mobile bid modifiers that may have been set.
For more information about bid modifiers, please see the Google Ads Help Center article .
Return values:
Type | Description |
---|---|
double
|
The mobile bid modifier. |
getName()
Returns the name of the ad group. Return values:
Type | Description |
---|---|
String
|
Name of the ad group. |
getResourceName()
Returns the resource name of the ad group. Return values:
Type | Description |
---|---|
String
|
The resource name of the ad group. |
getStatsFor(dateRange)
Returns stats for the specified date range. Supported values: TODAY, YESTERDAY, LAST_7_DAYS, THIS_WEEK_SUN_TODAY, LAST_WEEK,
LAST_14_DAYS, LAST_30_DAYS, LAST_BUSINESS_WEEK, LAST_WEEK_SUN_SAT,
THIS_MONTH, LAST_MONTH, ALL_TIME
.
Example:
var stats = adGroup . getStatsFor ( "THIS_MONTH" );
Arguments:
Name | Type | Description |
---|---|---|
dateRange
|
String
|
Date range for which the stats are requested. |
Return values:
Type | Description |
---|---|
AdsApp.Stats
|
The stats for the specified date range. |
getStatsFor(dateFrom, dateTo)
Returns stats for the specified custom date range. Both parameters can be
either an object containing year, month, and day fields, or an 8-digit
string in YYYYMMDD
form. For instance, March 24th,
2013
is represented as either {year: 2013, month: 3, day:
24}
or "20130324"
. The date range is inclusive on both
ends, so forDateRange("20130324", "20130324")
defines a range
of a single day. Arguments:
Name | Type | Description |
---|---|---|
dateFrom
|
Object
|
Start date of the date range. Must be either a string in YYYYMMDD
form, or an object with year
, month
and day
properties. |
dateTo
|
Object
|
End date of the date range. Must be either a string in YYYYMMDD
form, or an object with year
, month
and day
properties. |
Return values:
Type | Description |
---|---|
AdsApp.Stats
|
The stats for the specified date range. |
isEnabled()
Returns true
if the ad group is enabled. Return values:
Type | Description |
---|---|
boolean
|
true
if the ad group is enabled. |
isPaused()
Returns true
if the ad group is paused. Return values:
Type | Description |
---|---|
boolean
|
true
if the ad group is paused. |
isRemoved()
Returns true
if the ad group is removed. Return values:
Type | Description |
---|---|
boolean
|
true
if the ad group is removed. |
keywords()
Returns the selector of all keywords in the ad group. Return values:
Type | Description |
---|---|
AdsApp.KeywordSelector
|
The selector of all keywords in the ad group. |
labels()
Creates a selector of all labels applied to the ad group. Return values:
Type | Description |
---|---|
AdsApp.LabelSelector
|
Selector of all labels applied to the ad group. |
negativeKeywords()
Returns a selector of all negative keywords in the ad group. Return values:
Type | Description |
---|---|
AdsApp.NegativeKeywordSelector
|
The selector of all negative keywords in the ad group. |
newAd()
Returns a new ad builder space associated with this ad group. Return values:
Type | Description |
---|---|
AdsApp.AdBuilderSpace
|
A new ad builder space associated with this ad group. |
newKeywordBuilder()
Returns a new keyword builder associated with this ad group. Return values:
Type | Description |
---|---|
AdsApp.KeywordBuilder
|
A new keyword builder associated with this ad group. |
pause()
Pauses the ad group. Returns nothing.
recommendations()
Returns the selector of all recommendations for this ad group. Return values:
Type | Description |
---|---|
AdsApp.RecommendationSelector
|
The selector of all recommendations for this ad group. |
removeCallout(calloutExtension)
Removes a callout extension from this ad group. Returns nothing.
Arguments:
Name | Type | Description |
---|---|---|
calloutExtension
|
AdsApp.Callout
|
The callout to remove from this ad group. |
removeLabel(name)
Removes a label from the ad group. name
of the
label is case-sensitive. Operation will fail if the label with the
specified name does not already exist in the account. Returns nothing.
Arguments:
Name | Type | Description |
---|---|---|
name
|
String
|
Name of the label. |
removeMobileApp(mobileAppExtension)
Removes a mobile app extension from this ad group. Returns nothing.
Arguments:
Name | Type | Description |
---|---|---|
mobileAppExtension
|
AdsApp.MobileApp
|
The mobile app to remove from this ad group. |
removePhoneNumber(phoneNumberExtension)
Removes a phone number extension from this ad group. Returns nothing.
Arguments:
Name | Type | Description |
---|---|---|
phoneNumberExtension
|
AdsApp.PhoneNumber
|
The phone number to remove from this ad group. |
removePrice(priceExtension)
Removes a price extension from this ad group. Returns nothing.
Arguments:
Name | Type | Description |
---|---|---|
priceExtension
|
AdsApp.Price
|
The price to remove from this ad group. |
removeSitelink(sitelinkExtension)
Removes a sitelink extension from this ad group. Returns nothing.
Arguments:
Name | Type | Description |
---|---|---|
sitelinkExtension
|
AdsApp.Sitelink
|
The sitelink to remove from this ad group. |
removeSnippet(snippetExtension)
Removes a snippet extension from this ad group. Returns nothing.
Arguments:
Name | Type | Description |
---|---|---|
snippetExtension
|
AdsApp.Snippet
|
The snippet to remove from this ad group. |
setMobileBidModifier(modifier)
Sets the mobile bid modifier for this ad group to the specified value. setMobileBidModifier(modifier)
The bid modifier is a multiplier applied to the ad group's bids on
mobile devices. So, for instance, a bid modifier of 1.1
increases the bid to 110% of its original value, and changes a bid of $5.00
to $5.50.
The operation will fail if the ad group's campaign has a mobile bid modifier of -1 (i.e. -100%). Setting a campaign mobile bid modifier to -1 will opt the entire campaign out of mobile.
Note that when you set a mobile bid modifier at both campaign- and ad group-level in a single campaign, the ad group mobile bid modifier will be used when determining your bid UNLESS the campaign mobile bid modifier is set to -1 (i.e. -100%) which will opt the entire campaign out of mobile regardless of any ad group mobile bid modifiers that may be set.
For more information about bid modifiers, please see the Google Ads Help Center article .
Returns nothing.
Arguments:
Name | Type | Description |
---|---|---|
modifier
|
double
|
The new mobile bid modifier. |
setName(name)
Sets the name of the ad group. Returns nothing.
Arguments:
Name | Type | Description |
---|---|---|
name
|
String
|
The new name for the ad group. |
targeting()
Provides access to ad group-level targeting criteria: audiences. SearchAdGroupAudience
, SearchAdGroupExcludedAudience
, Return values:
Type | Description |
---|---|
AdsApp.AdGroupTargeting
|
Access to certain kinds of targeting criteria in this ad group. |
urls()
Provides access to this ad group's URL fields. See Using Upgraded
URLs
for more information. Return values:
Type | Description |
---|---|
AdsApp.AdGroupUrls
|
Access to this ad group's URL fields. |