This will look at the following properties of the given object:
dayOfWeek: Required. Must be one
of "MONDAY", "TUESDAY",
"WEDNESDAY", "THURSDAY",
"FRIDAY", "SATURDAY", or
"SUNDAY".
startHour and startMinute:
Required. The starting time of this segment of
the ad schedule. startHour must be an integer
between 0 and 23, and
startMinute must be either 0,
15, 30, or 45. For
instance, a startHour of 18 and a
startMinute of 30 would result in an
ad schedule starting at 6:30PM. Acceptable starting times range
from 00:00 to 23:45.
endHour and endMinute:
Required. The ending time of this segment of
the ad schedule. endHour must be an integer
between 0 and 24, and
endMinute must be either 0,
15, 30, or 45. For
instance, a endHour of 18 and a
endMinute of 30 would result in an ad
schedule ending at 6:30PM. Acceptable ending times range from
00:15 to 24:00.
bidModifier: Optional. The bid
modifier for this segment of the ad schedule.
One thing to keep in mind is that, by default, campaigns have no ad
schedule criteria and hence serve ads at all times. Adding the first ad
schedule to a campaign will cause ads to be shown during that time only.
One thing to keep in mind is that, by default, campaigns have no ad
schedule criteria and hence serve ads at all times. Adding the first ad
schedule to a campaign will cause ads to be shown during that time only.
Arguments:
Name
Type
Description
dayOfWeek
String
The day of week. Must be one of "MONDAY",
"TUESDAY", "WEDNESDAY",
"THURSDAY", "FRIDAY",
"SATURDAY", or "SUNDAY".
startHour
int
The start hour. Must be an integer between 0
and 23. Acceptable starting times range from
00:00 to 23:45.
startMinute
int
The start minute. Must be either 0,
15, 30, or 45. Acceptable
starting times range from 00:00 to 23:45.
endHour
int
The end hour. Must be an integer between 0 and
24. Acceptable ending times range from 00:15
to 24:00.
endMinute
int
The end minute. Must be either 0,
15, 30, or 45. Acceptable ending
times range from 00:15 to 24:00.
bidModifier
double
Optional. The bid modifier to use for
the newly created ad schedule.
Creates a location target in this campaign from a location ID. Once
created, the campaign will start showing ads to the location with the given
location ID.
Creates a location target in this campaign from a location. Once created,
the campaign will start showing ads to the location with the given location
ID.
You must specify an existing TargetedLocation object, perhaps
from another campaign:
Creates a location target in this campaign from a location JSON. Once
created, the campaign will start showing ads to the location with the given
location ID.
You must specify a plain JavaScript object describing a location. For
instance, this would create a location target for Tennessee:
Creates a location target in this campaign from a location ID and bid
modifier. Once created, the campaign will start showing ads to the location
with the given location ID.
For instance, this will create a location target for Tennessee with a
bid modifier of 1.15:
The negative keyword list to be added to this
campaign.
addProximity(proximity)
Creates a proximity target in this campaign from a proximity object. Once
created, the shopping campaign will start showing ads to geographical
points within the specified radius of the specified central point.
When called with one argument, addProximity supports two
kinds of input:
This will look at the following properties of the given object:
latitude and longitude:
Required. The central geographic point of the
proximity to target.
radius and radiusUnits:
Required. The radius around the central point
to target. radiusUnits must be either
"MILES" or "KILOMETERS".
bidModifier: Optional. The bid
modifier for this proximity.
address: Optional. The address
associated with the central geographical point.
If present, this is expected to be an object, which contains
any of streetAddress, streetAddress2,
cityName, provinceName,
provinceCode, postalCode, and
countryCode as properties with string values. This
corresponds to the Address
objects returned by existing proximity targets.
There is no validation to check that the address actually
belongs to the given latitude and longitude. It has no
functionality except to change what shows up in the Campaign
Management interface.
Creates a proximity target in this campaign. Once created, the shopping
campaign will start showing ads to geographical points within the specified
radius of the specified central point.
For instance, this will create a proximity targeting 20km around Google
headquarters:
The units of the radius, either "MILES" or
"KILOMETERS".
optArgs
Object
Optional. Either a number, which will be
interpreted as the desired bid modifier for the proximity, or an object
containing extra additional arguments.
For TargetedProximities, there are two supported
optional arguments:
bidModifier: The bid modifier for this proximity.
address: The address associated with the central
geographical point.
If present, this is expected to be an object, which contains
any of streetAddress, streetAddress2,
cityName, provinceName,
provinceCode, postalCode, and
countryCode as properties with string values. This
corresponds to the Address
objects returned by existing proximity targets.
There is no validation to check that the address actually
belongs to the given latitude and longitude. It has no
functionality except to change what shows up in the Campaign
Management interface.
The selector of all product ads in the shopping campaign.
applyLabel(name)
Applies a label to the shopping campaign. 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 campaign 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 shopping campaign's bidding fields.
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.
A selector of negative keyword lists associated with this campaign.
negativeKeywords()
Returns a selector of the campaign-level negative keywords belonging to
this campaign.
Note that this selector will not return any
negative keywords belonging to this campaign's child ad groups — it only
returns campaign-level negative keywords.
The selector of all recommendations for this campaign.
removeLabel(name)
Removes a label from the shopping campaign. 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.
removeNegativeKeywordList(negativeKeywordList)
Removes a negative keyword list from this campaign.
The negative keyword list to be removed from
this campaign.
setAdRotationType(adRotationType)
Sets the ad rotation type of the shopping campaign.
For instance, campaign.setAdRotationType("OPTIMIZE");
instructs Google Ads to optimize ad serving based on the shopping
campaign's CTR. For more information, see Choose an ad delivery
method help article.
Returns nothing.
Arguments:
Name
Type
Description
adRotationType
String
The new ad rotation type of the shopping campaign.
Must be one of "OPTIMIZE",
"CONVERSION_OPTIMIZE", "ROTATE", or
"ROTATE_FOREVER".
setEndDate(date)
Sets the shopping campaign's end date from either an object containing
year, month, and day fields, or an 8-digit string in YYYYMMDD
format.
For instance, campaign.setEndDate("20130503"); is
equivalent to campaign.setEndDate({year: 2013, month: 5, day:
3});.
The change will fail and report an error if:
the given date is invalid (e.g.,
{year: 2013, month: 5, day: 55}),
it's a date in the past, or
it's a date after the latest allowed end date of December 30, 2037.
Returns nothing.
Arguments:
Name
Type
Description
date
Object
The new campaign end date.
setName(name)
Sets the name of the shopping campaign.
Returns nothing.
Arguments:
Name
Type
Description
name
String
The new name for the shopping campaign.
setStartDate(date)
Sets the shopping campaign's start date from either an object containing
year, month, and day fields, or an 8-digit string in YYYYMMDD
format.
For instance, campaign.setStartDate("20130503"); is
equivalent to campaign.setStartDate({year: 2013, month: 5, day:
3});.
The change will fail and report an error if:
the shopping campaign has already started,
the given date is invalid (e.g.,
{year: 2013, month: 5, day: 55}),
the given date is after the shopping campaign's end date,
it's a date in the past, or
it's a date after the latest allowed end date of December 30, 2037.
Returns nothing.
Arguments:
Name
Type
Description
date
Object
The new campaign end date.
targeting()
Provides access to campaign-level targeting criteria: device targeting, ad
scheduling, location targeting, and audiences.
[null,null,["Last updated 2024-10-18 UTC."],[[["The `ShoppingCampaign` object in Google Ads Scripts enables programmatic management of Shopping campaigns, including their settings and components."],["Key functionalities include managing labels, bidding strategies, campaign status, dates, negative keywords, ad creation, product groups, recommendations, targeting, and URLs."],["Detailed method descriptions provide instructions for interacting with each aspect of a Shopping campaign."],["Use the provided methods to control various aspects of your campaigns, such as targeting, scheduling, bidding, and performance tracking for optimization."],["This documentation empowers users to automate and streamline their Google Ads shopping campaign management through scripting."]]],[]]