How can I get started?
Find the script here.
If you have any questions or need additional help, contact us via the forum.
const budgetResult = AdsApp.mutate({ campaignBudgetOperation: { create: { amountMicros: 10000000, explicitlyShared: false } } });The new functionality enables you to create full campaign hierarchies, new conversion actions, and more that previously was not possible in scripts. For a full list of available operations, check out the MutateOperation reference documentation for the Google Ads API. Note that a few operation types are still restricted in scripts.
The new equivalent code would be:
const draft = campaign.newDraftBuilder()
.withName(newDraftName)
.build()
.getResult();
// Modify the draft campaign before beginning the experiment.
const draftCampaign = draft.getDraftCampaign();
const experiment = draft.newExperimentBuilder()
.withName(newExperimentName)
.withTrafficSplitPercent(50)
.startBuilding();
This change will allow us to bring further improvements to this feature as they are added in the Google Ads API.
const experiment = AdsApp.newExperimentBuilder()
.withCampaign(campaign)
.withTrafficSplitPercent(50)
// Some new fields are required.
.withStartDate("20230501")
.withEndDate("20230601")
.withType("SEARCH_CUSTOM")
// The suffix will automatically be added to the end of the name for
// each experiment campaign.
.withSuffix("experiment")
// Goals have no effect on the serving of the experiment, but instead
// just help you keep track of your intentions.
.withGoals([{metric: 'CLICKS', direction: 'INCREASE'}])
.build();
// The experiment campaign is the new equivalent of the draft campaign
// in the example above.
const experimentCampaign = experiment.getExperimentCampaign();
UserListService.MutateUserLists
or audiences using AudienceService.MutateAudiences
.CampaignCriterionService.MutateCampaignCriteria
or at ad group-level using AdGroupCriterionService.MutateAdGroupCriteria
.ConversionValueRuleService.MutateConversionValueRules
.GoogleAdsService.Search
or GoogleAdsService.SearchStream
requests will gradually be depleted of any references to Similar Audiences. This includes queries relying on the reports user_list
, audience
, combined_audience
, and any others that are based on targeting, or conversion values segments or metrics. When we get closer to the sunset date, check out the deprecation and sunset guide for the exact errors that will be thrown.AdsApp.UserList
.AdsApp.Targeting
, AdsApp.CampaignTargeting
, or AdsApp.AccountAdGroupTargeting
.user_list
, audience
, combined_audience
, and any others that are based on targeting, or conversion values segments or metrics.Between April 25th 2:32 PM PT and April 26th 12:24 PM PT, there was an issue which may have impacted some read report requests across Google Ads scripts, the AdWords API, and the Google Ads API. If you were using these products to request reporting data for your accounts, then a small percentage of report downloads may have been missing rows or may have had incorrect data in a given row. This issue has been resolved. As a precaution, we recommend running again any reports that you have executed during this period as the missing data has been restored.
If you have any questions, please contact us via the Google Ads API forum or the Google Ads scripts forum.
let
, classes, for..of
loops, and more.