Experiment modifications in Google Adverts scripts
You possibly can learn extra about this characteristic in our Drafts and Experiments information.
To summarize the brand new modifications in a easy instance, should you had code resembling:
const draft = marketing campaign.newDraftBuilder() .withName(newDraftName) .construct() .getResult(); // Modify the draft marketing campaign earlier than starting the experiment. const draftCampaign = draft.getDraftCampaign(); const experiment = draft.newExperimentBuilder() .withName(newExperimentName) .withTrafficSplitPercent(50) .startBuilding();
The brand new equal code could be:
const experiment = AdsApp.newExperimentBuilder()
.withCampaign(marketing campaign)
.withTrafficSplitPercent(50)
// Some new fields are required.
.withStartDate("20230501")
.withEndDate("20230601")
.withType("SEARCH_CUSTOM")
// The suffix will routinely be added to the tip of the title for
// every experiment marketing campaign.
.withSuffix("experiment")
// Targets haven't any impact on the serving of the experiment, however as a substitute
// simply provide help to maintain monitor of your intentions.
.withGoals([{metric: 'CLICKS', direction: 'INCREASE'}])
.construct();
// The experiment marketing campaign is the brand new equal of the draft marketing campaign
// within the instance above.
const experimentCampaign = experiment.getExperimentCampaign();
This alteration will permit us to convey additional enhancements to this characteristic as they’re added within the Google Adverts API.
If in case you have any questions or suggestions, please go away a publish on our discussion board or ship a message to our assist alias googleadsscripts-support@google.com.