Asset optimization experiments are used to test different asset combinations within Performance Max campaigns, allowing you to compare how different sets of assets perform against a base set.
This workflow is supported for
ExperimentType.OPTIMIZE_ASSETS.
Setup
To set up an asset optimization experiment:
- Create a new asset, an experiment with control and treatment arms.
- Link the new asset to the treatment arm's asset group—all within a single mutate request.
Because these entities are interdependent, you must use temporary resource names to refer to resources created in earlier operations within the same request.
The operations in your request must be in the following order:
- Create an
Assetwith a temporary resource name (such ascustomers/CUSTOMER_ID/assets/-1). This will be your test asset. - Create an
Experimentwith a temporary resource name (for example,customers/CUSTOMER_ID/experiments/-2). - Create two
ExperimentArmresources:- A control arm linked to a base
AssetGroup. - A treatment arm linked to the same base
AssetGroup. In this arm, set theasset_groupsfield using the temporary resource name of the asset created in step 1.
- A control arm linked to a base
- Create an
AssetGroupAssetlinking the asset from step 1 to the asset group used in the experiment arms.
Java
This example is not yet available in Java; you can take a look at the other languages.
C#
This example is not yet available in C#; you can take a look at the other languages.
PHP
This example is not yet available in PHP; you can take a look at the other languages.
Python
# 1. Create Assets with temporary resource names. # We create a text asset and an image asset to showcase different types. asset_operation_1 = create_text_asset_operation( client, customer_id, ASSET_1_TEMP_ID, "Fly to Mars with Interplanetary Cruises!", ) asset_operation_2 = create_image_asset_operation( client, customer_id, ASSET_2_TEMP_ID, "https://gaagl.page.link/Eit5", "Mars Landscape View", ) # 2. Create an Experiment with a temporary resource name. experiment_operation = client.get_type("MutateOperation") experiment = experiment_operation.experiment_operation.create experiment.resource_name = googleads_service.experiment_path( customer_id, EXPERIMENT_TEMP_ID ) experiment.name = f"Interstellar Asset Experiment #{uuid4()}" experiment.type_ = client.enums.ExperimentTypeEnum.OPTIMIZE_ASSETS # Set the optimize assets experiment subtype to COMPARE_ASSETS. experiment.optimize_assets_experiment.optimize_assets_experiment_subtype = ( client.enums.OptimizeAssetsExperimentSubtypeEnum.COMPARE_ASSETS ) experiment.status = client.enums.ExperimentStatusEnum.SETUP # 3. Create two ExperimentArm resources. treatment_assets = [ (ASSET_1_TEMP_ID, client.enums.AssetFieldTypeEnum.HEADLINE), (ASSET_2_TEMP_ID, client.enums.AssetFieldTypeEnum.MARKETING_IMAGE), ] arm_operations = create_arms_operations( client, customer_id, EXPERIMENT_TEMP_ID, asset_group_id, treatment_assets, ) # 4. Create AssetGroupAssets linking the assets to the asset group. asset_group_asset_operation_1 = create_asset_group_asset_operation( client, customer_id, asset_group_id, ASSET_1_TEMP_ID, client.enums.AssetFieldTypeEnum.HEADLINE, ) asset_group_asset_operation_2 = create_asset_group_asset_operation( client, customer_id, asset_group_id, ASSET_2_TEMP_ID, client.enums.AssetFieldTypeEnum.MARKETING_IMAGE, ) # Send all operations in a single Mutate request. # The operations must be in this specific order. mutate_operations = [ asset_operation_1, asset_operation_2, experiment_operation, *arm_operations, asset_group_asset_operation_1, asset_group_asset_operation_2, ] response = googleads_service.mutate( customer_id=customer_id, mutate_operations=mutate_operations, )
Ruby
This example is not yet available in Ruby; you can take a look at the other languages.
Perl
This example is not yet available in Perl; you can take a look at the other languages.
curl
Report on the experiment
You can report on asset optimization experiments using the
experiment resource to compare metrics between the control and treatment asset
groups.
Graduate or end
After evaluating the results, you can either end or graduate the experiment
using ExperimentService.
- End: If you are not satisfied with the results from the treatment arm,
use
EndExperiment. This is a synchronous operation. - Graduate: If you prefer the performance of the treatment arm's asset
group, use
GraduateExperiment. As part of this process, the original base campaign associated with the control arm is paused, and the treatment arm is converted to a new, independent campaign. This is a synchronous operation.