AdsApp.​ShoppingAdGroup

Represents a shopping ad group.

Methods:

MemberTypeDescription
adsAdsApp.ProductAdSelectorReturns the selector of all product ads in the shopping ad group.
applyLabelvoidApplies a label to the shopping ad group.
biddingAdsApp.ShoppingAdGroupBiddingProvides access to this shopping ad group's bidding fields.
createNegativeKeywordvoidCreates a new negative keyword with the specified text.
createRootProductGroupAdsApp.ProductGroupOperationCreates the root product group of the shopping ad group (if one doesn't already exist).
devicesAdsApp.AdGroupDevicesReturns an AdGroupDevices instance associated with the shopping ad group.
enablevoidEnables the shopping ad group.
getCampaignAdsApp.ShoppingCampaignReturns the shopping campaign to which this shopping ad group belongs.
getEntityTypeStringReturns the type of this entity as a String, in this case, "ShoppingAdGroup".
getIdStringReturns the ID of the shopping ad group.
getMobileBidModifierdoubleReturns the mobile bid modifier for this ad group.
getNameStringReturns the name of the shopping ad group.
getResourceNameStringReturns the resource name of the shopping ad group.
getStatsForAdsApp.StatsReturns stats for the specified date range.
getStatsForAdsApp.StatsReturns stats for the specified custom date range.
isEnabledbooleanReturns true if the shopping ad group is enabled.
isPausedbooleanReturns true if the shopping ad group is paused.
isRemovedbooleanReturns true if the shopping ad group is removed.
labelsAdsApp.LabelSelectorCreates a selector of all labels applied to the shopping ad group.
negativeKeywordsAdsApp.NegativeKeywordSelectorReturns a selector of all negative keywords in the ad group.
newAdBuilderAdsApp.ProductAdBuilderReturns a product ad builder.
pausevoidPauses the shopping ad group.
productGroupsAdsApp.ProductGroupSelectorReturns the selector of all product groups in the shopping ad group.
recommendationsAdsApp.RecommendationSelectorReturns the selector of all recommendations for this ad group.
removeLabelvoidRemoves a label from the shopping ad group.
rootProductGroupAdsApp.ProductGroupReturns the root product group of the shopping ad group or null if one does not exist.
setMobileBidModifiervoidSets the mobile bid modifier for this ad group to the specified value.
setNamevoidSets the name of the shopping ad group.
targetingAdsApp.ShoppingAdGroupTargetingProvides access to this shopping ad group's targeting criteria: audiences

ads()

Returns the selector of all product ads in the shopping ad group.

Return values:

TypeDescription
AdsApp.ProductAdSelectorThe selector of all product ads in the shopping ad group.

applyLabel(name)

Applies a label to the shopping 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 shopping ad group cannot have more than 50 labels.

Returns nothing.

Arguments:

NameTypeDescription
nameStringName of the label to apply.

bidding()

Provides access to this shopping ad group's bidding fields.

Return values:

TypeDescription
AdsApp.ShoppingAdGroupBiddingAccess to this shopping ad group's bidding fields.

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:

NameTypeDescription
keywordTextStringThe text of the new negative keyword.

createRootProductGroup()

Creates the root product group of the shopping ad group (if one doesn't already exist). Newly constructed shopping ad groups as well as ones modified by other means may not have any product groups.

Return values:

TypeDescription
AdsApp.ProductGroupOperationThe operation resulting from trying to create the root product group for this shopping ad group.

devices()

Returns an AdGroupDevices instance associated with the shopping ad group.

Return values:

TypeDescription
AdsApp.AdGroupDevicesAn AdGroupDevices instance associated with the shopping ad group.

enable()

Enables the shopping ad group.

Returns nothing.

getCampaign()

Returns the shopping campaign to which this shopping ad group belongs.

Return values:

TypeDescription
AdsApp.ShoppingCampaignThe shopping campaign to which this shopping ad group belongs.

getEntityType()

Returns the type of this entity as a String, in this case, "ShoppingAdGroup".

Return values:

TypeDescription
StringType of this entity: "ShoppingAdGroup".

getId()

Returns the ID of the shopping ad group.

Return values:

TypeDescription
StringThe ID of the shopping ad group.

getMobileBidModifier()

Returns the mobile bid modifier for this ad group.

The bid modifier is a multiplier applied to the shopping 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 shopping ad group mobile bid modifier will be used when determining your bid.

For more information about bid modifiers, please see the Google Ads Help Center article.

Return values:

TypeDescription
doubleThe mobile bid modifier.

getName()

Returns the name of the shopping ad group.

Return values:

TypeDescription
StringName of the shopping ad group.

getResourceName()

Returns the resource name of the shopping ad group.

Return values:

TypeDescription
StringThe resource name of the shopping 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 = shoppingAdGroup.getStatsFor("THIS_MONTH");

Arguments:

NameTypeDescription
dateRangeStringDate range for which the stats are requested.

Return values:

TypeDescription
AdsApp.StatsThe 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:

NameTypeDescription
dateFromObjectStart date of the date range. Must be either a string in YYYYMMDD form, or an object with year, month and day properties.
dateToObjectEnd date of the date range. Must be either a string in YYYYMMDD form, or an object with year, month and day properties.

Return values:

TypeDescription
AdsApp.StatsThe stats for the specified date range.

isEnabled()

Returns true if the shopping ad group is enabled.

Return values:

TypeDescription
booleantrue if the shopping ad group is enabled.

isPaused()

Returns true if the shopping ad group is paused.

Return values:

TypeDescription
booleantrue if the shopping ad group is paused.

isRemoved()

Returns true if the shopping ad group is removed.

Return values:

TypeDescription
booleantrue if the shopping ad group is removed.

labels()

Creates a selector of all labels applied to the shopping ad group.

Return values:

TypeDescription
AdsApp.LabelSelectorSelector of all labels applied to the shopping ad group.

negativeKeywords()

Returns a selector of all negative keywords in the ad group.

Return values:

TypeDescription
AdsApp.NegativeKeywordSelectorThe selector of all negative keywords in the ad group.

newAdBuilder()

Returns a product ad builder.

Return values:

TypeDescription
AdsApp.ProductAdBuilderA product ad builder.

pause()

Pauses the shopping ad group.

Returns nothing.

productGroups()

Returns the selector of all product groups in the shopping ad group.

Return values:

TypeDescription
AdsApp.ProductGroupSelectorThe selector of all product groups in the shopping ad group.

recommendations()

Returns the selector of all recommendations for this ad group.

Return values:

TypeDescription
AdsApp.RecommendationSelectorThe selector of all recommendations for this ad group.

removeLabel(name)

Removes a label from the shopping 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:

NameTypeDescription
nameStringName of the label.

rootProductGroup()

Returns the root product group of the shopping ad group or null if one does not exist.

Return values:

TypeDescription
AdsApp.ProductGroupThe root product group of the shopping ad group or null if one does not exist.

setMobileBidModifier(modifier)

Sets the mobile bid modifier for this ad group to the specified value.

The bid modifier is a multiplier applied to the shopping 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 shopping ad group mobile bid modifier will be used when determining your bid.

For more information about bid modifiers, please see the Google Ads Help Center article.

Returns nothing.

Arguments:

NameTypeDescription
modifierdoubleThe new mobile bid modifier.

setName(name)

Sets the name of the shopping ad group.

Returns nothing.

Arguments:

NameTypeDescription
nameStringThe new name for the shopping ad group.

targeting()

Provides access to this shopping ad group's targeting criteria: audiences

ShoppingAdGroupAudience

Return values:

TypeDescription
AdsApp.ShoppingAdGroupTargetingAccess to this ad group's targeting criteria.