Returns the selector of all shopping ad groups in the shopping campaign.
Creates an ad schedule criterion.
Creates an ad schedule criterion. Once created, the campaign will start showing ads during the specified time.
For instance, this will create an ad schedule covering Saturday mornings:
var campaign = AdWordsApp.campaigns().get().next(); campaign.addAdSchedule("SATURDAY", 7, 0, 11, 0);
This will create the same schedule, but with a bid modifier of 1.1
:
var campaign = AdWordsApp.campaigns().get().next(); campaign.addAdSchedule("SATURDAY", 7, 0, 11, 0, 1.1);
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.
Returns nothing.
Creates a location target in this campaign from a location ID and bid modifier.
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
:
var campaign = AdWordsApp.campaigns().get().next(); campaign.addLocation(21175, 1.15);
Returns nothing.
Creates a proximity target in this campaign.
Creates a proximity target in this campaign. Once created, the 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:
var campaign = AdWordsApp.campaigns().get().next(); campaign.addProximity(37.423021, -122.083739, 20, "KILOMETERS");Similarly, to create the same proximity target with a bid modifier and address:
campaign.addProximity(37.423021, -122.083739, 20, "KILOMETERS", { bidModifier: 1.15, address: { streetAddress: "1600 Amphitheatre Parkway", cityName: "Mountain View", provinceName: "California", provinceCode: "CA", postalCode: "94043", countryCode: "US" } });
Returns nothing.
Returns the selector of all product ads in the shopping campaign.
Applies a label to the campaign.
Applies a label to the 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 campaign cannot not have more than 50 labels.
Returns nothing.
Provides access to this shopping campaign's bidding fields.
Creates a new campaign-level negative keyword with the specified text.
Creates a new campaign-level 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.
Enables the campaign.
Enables the campaign.
Returns nothing.
Creates a location exclusion in this campaign.
Creates a location exclusion in this campaign. Once created, the campaign will not show ads to the location with the given location ID.
This method accepts three forms of input:
var campaign = AdWordsApp.campaigns().get().next(); campaign.excludeLocation(21175);
var campaigns = AdWordsApp.campaigns().get(); var campaign1 = campaigns.next(); var campaign2 = campaigns.next(); var location = campaign1.targeting().excludedLocations().get().next(); campaign2.excludeLocation(location);
var campaign = AdWordsApp.campaigns().get().next(); campaign.excludeLocation({ id: 21175 });The only field of the object which will be looked at is
id
, which represents the location ID.Returns nothing.
}); Returns nothing.
Returns the ad rotation type of the campaign.
Returns the ad rotation type of the campaign. Possible return values:
OPTIMIZE, CONVERSION_OPTIMIZE, ROTATE, ROTATE_FOREVER
Returns the bidding strategy type of the campaign.
Returns the bidding strategy type of the campaign. Possible return values:
MANUAL_CPC, MANUAL_CPM, BUDGET_OPTIMIZER, CONVERSION_OPTIMIZER, PERCENT_CPA
Returns the budget of the campaign.
Returns the budget of the campaign. In order to change the campaign's budget, use Budget.setAmount(double) .
Returns the campaign's end date, or
null
if there is no end date.
Returns the campaign's end date, or
null
if there is no end date. For instance, if a campaign ended on May 3, 2013, this would return the following object:
{year: 2013, month: 5, day: 3}
.
Returns the type of this entity as a
String
, in this case,
"Campaign"
.
Returns the type of this entity as a
String
, in this case,
"Campaign"
.
Returns the ID of the campaign.
Returns the ID of the campaign.
Returns the name of the campaign.
Returns the name of the campaign.
Returns the campaign's start date.
Returns the campaign's start date. For instance, if a campaign started on May 3, 2013, this would return the following object:
{year: 2013, month: 5, day: 3}
.
Returns stats for the specified custom date range.
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.
Returns
true
if the shopping campaign is deleted.
Returns
true
if the shopping campaign is deleted.
Returns
true
if the campaign is enabled.
Returns
true
if the campaign is enabled.
Returns
true
if the campaign is paused.
Returns
true
if the campaign is paused.
Creates a selector of all labels applied to the campaign.
Creates a selector of all labels applied to the campaign.
Returns a selector of the campaign-level negative keywords belonging to this campaign.
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.
Returns a new shopping ad group builder for this shopping campaign.
Pauses the campaign.
Pauses the campaign.
Returns nothing.
Returns the selector of all product groups in the campaign.
Removes a label from the campaign.
Removes a label from the 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.
Sets the ad rotation type of the campaign.
Sets the ad rotation type of the campaign. For instance,
campaign.setAdRotationType("OPTIMIZE");
instructs AdWords to optimize ad serving based on the campaign's CTR. For more information, see
Choose an ad delivery method
help article.
Returns nothing.
Sets the campaign's end date from either an object containing year, month, and day fields, or an 8-digit string in
YYYYMMDD
format.
Sets the 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:
{year: 2013, month: 5, day: 55}
),Returns nothing.
Sets the name of the campaign.
Sets the name of the campaign.
Returns nothing.
Sets the campaign's start date from either an object containing year, month, and day fields, or an 8-digit string in
YYYYMMDD
format.
Sets the 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:
{year: 2013, month: 5, day: 55}
),Returns nothing.
Provides access to campaign-level targeting criteria: device targeting, ad scheduling, and location targeting.
Provides access to campaign-level targeting criteria: device targeting, ad scheduling, and location targeting.
Represents a shopping campaign.