Access to manage AdWords Campaign Experiments (ACE) has been introduced through the ExperimentService as part of the v201008 version of the AdWords API. Now you are able to configure split test experiments for a campaign through the API. A split test experiment lets you more precisely measure the impact of changes to keywords, bids, ad groups, and placements before you apply them to all auctions. This reduces guesswork and lowers the potential risk. For common usage scenarios and more details, check out this blog post and the AdWords Help Center.
Lets get hands on with the code and see how to use ACE via the AdWords API. The following code snippets are available as part of the Perl client library.
Creating your experiment
You start by defining your experiment, which includes creating the experiment, attaching it to a campaign, setting its start time, end time, and percentage split. You then send an add operation through a service mutate call.
# Create experiment.
my $experiment = Google::Ads::AdWords::v201008::Experiment->new({
campaignId => $campaign_id,
name => "Interplanetary Experiment #" . POSIX::strftime("%s", localtime),
queryPercentage => 10,
startDateTime => POSIX::strftime("%Y%m%d %H%M%S", localtime)
});
# Create operation.
my $experiment_operation =
Google::Ads::AdWords::v201008::ExperimentOperation->new({
operator => "ADD",
operand => $experiment
});
# Add experiment.
my $result = $client->ExperimentService()->mutate({
operations => [$experiment_operation]
});
# Valuable for ValueTrack usage
my $experiment_id = $experiments->get_entries()->[0]->get_id();
my $control_id = $experiments->get_entries()->[0]->get_controlId();
In the last few lines of code, experiment id and control id are extracted from the just-created experiment. These values are important for use with the ValueTrack tag used for campaign tracking and analytics since they uniquely identify which split each click is coming from. For details on using the ValueTrack tag with ACE please consult the
AdWords Help Center.
Defining your experimental changes
Now lets apply some bid changes to an existing ad group and assign it to both the experimental and the control splits by using the flag named
experimentDeltaStatus
. Applying changes to other parts of your campaign are very similar to the following example, refer to the
AdGroupExperimentData
and the
BiddableAdGroupCriterionExperimentData
objects in documentation for more information about the experimental changes that can be applied to ad groups and criteria respectively. It is also worth to mention that new ad groups and new criteria can be added to your campaign experiment executing add operations and setting the
experimentData
to your new objects. You can also check a variety of experiment examples which we included in
client libraries.
# Set ad group for the experiment.
my $ad_group = Google::Ads::AdWords::v201008::AdGroup->new({
id => $ad_group_id
});
# Create experiment bid multiplier rule that will modify ad group bid for the
# experiment.
my $bid_multiplier =
Google::Ads::AdWords::v201008::ManualCPCAdGroupExperimentBidMultipliers->
new({
maxCpcMultiplier => Google::Ads::AdWords::v201008::BidMultiplier->
new({
multiplier => 1.5
})
});
# Set experiment data to the ad group.
my $experiment_data =
Google::Ads::AdWords::v201008::AdGroupExperimentData->new({
experimentId => $experiment_id,
experimentDeltaStatus => "MODIFIED",
experimentBidMultipliers => $bid_multiplier
});
$ad_group->set_experimentData($experiment_data);
# Create operation.
my $operation = Google::Ads::AdWords::v201008::AdGroupOperation->new({
operand => $ad_group,
operator => "SET"
});
# Update ad group.
$experiments = $client->AdGroupService()->mutate({
operations => [$operation]
});
Deciding to promote or discard your experiment
After you’ve assessed the performance impact of the experimental changes, you can promote or delete the experiment. The following example shows you how to promote your experiment, effectively applying all experimental changes to 100% of your campaign traffic.
# Set experiment's status to PROMOTED.
my $experiment = Google::Ads::AdWords::v201008::Experiment->new({
id => $experiment_id,
status => "PROMOTED"
});
# Create operation.
my $experiment_operation =
Google::Ads::AdWords::v201008::ExperimentOperation->new({
operator => "SET",
operand => $experiment
});
# Update experiment.
my $result = $client->ExperimentService()->mutate({
operations => [$experiment_operation]
});
Promoting an experiment applies all changes in the experimental split to your campaign. All control only elements become paused. Everything else running in both control and experiment splits continues running as normal.
If you don’t like the performance impact you see with the experiment, you can delete it by sending a mutate operation with the experiment status set as DELETED. Deleting an experiment will effectively discard any changes and additions assigned to the experimental split.
Like other products in beta, ACE has some core features still undergoing active development. Reporting is one area that’s getting special attention. Currently, getting performance data segmented by experiment and control splits is not supported through the AdWords API. Until it’s available, you can pull click and conversion data for each split from a tracking system using ValueTrack tags, as described above. Alternatively, experiments can be implemented so that every ad group is either control only or experiment only. You can then aggregate results for each campaign split using each ad group’s
experimentDeltaStatus
and check for statistically significant differences. A final interim solution is for users to log into the AdWords UI to check segmented performance stats.
If you have any questions about how to use this service we’ll be happy to address them on the
forum. Have fun experimenting.
Best,
- David Torres, AdWords API Team