素材资源优化实验用于测试效果最大化广告系列中的不同素材资源组合,以便您比较不同素材资源组与基准组的效果。
此工作流适用于 ExperimentType.OPTIMIZE_ASSETS。
设置
如需设置素材资源优化实验,请执行以下操作:
- 创建新素材资源,并创建包含对照组和实验组的实验。
- 在单个 mutate 请求中,将新素材资源与实验组的素材资源组相关联。
前提条件
在创建素材资源优化实验之前,您必须拥有现有的效果最大化广告系列和作为两个实验组基准的基准 AssetGroup 资源 (customers/{customer_id}/assetGroups/{asset_group_id})。
请求操作顺序
由于这些实体相互依赖,因此您必须使用临时资源名称来引用同一请求中在之前操作中创建的资源。
请求中的操作必须按以下顺序进行:
- 创建具有临时资源名称(例如
customers/CUSTOMER_ID/assets/-1)的一个或多个Asset资源。这些是您的测试资产。 - 创建一个
Experiment,其中包含临时资源名称(例如customers/CUSTOMER_ID/experiments/-2)、设置为OPTIMIZE_ASSETS的type、设置为ENABLED的status以及设置为所选OptimizeAssetsExperimentSubtype(例如COMPARE_ASSETS)的optimize_assets_experiment.optimize_assets_experiment_subtype。 创建两个与第 2 步中的临时实验资源名称相关联的
ExperimentArm资源,并在每个实验组中设置campaigns(设置为效果最大化广告系列资源名称)、traffic_split(总和为100)和asset_groups(ExperimentArm.AssetGroupInfo):- 一个控制组 (
control = true),其中asset_groups包含一个AssetGroupInfo,且asset_group设置为基本AssetGroup的资源名称 (customers/CUSTOMER_ID/assetGroups/ASSET_GROUP_ID)。在针对基准素材资源组测试新添加的素材资源时(或在使用ADD_ASSETS_TO_ASSETLESS_RETAIL或ADD_VIDEO_ASSETS_TO_VIDEOLESS子类型时),请将控制组的asset_group_assets保持未设置状态;在比较COMPARE_ASSETS下的两个不同的素材资源集时,请列出控制组的AssetGroupAssetInfo条目(asset和field_type)。 - 一个实验组 (
control = false),其中asset_groups包含一个AssetGroupInfo,其asset_group设置为相同的基本AssetGroup资源名称 (customers/CUSTOMER_ID/assetGroups/ASSET_GROUP_ID) 和asset_group_assets(repeatedAssetGroupAssetInfo),列出了实验组的Asset资源和field_type,包括第 1 步中新创建的测试Asset(customers/CUSTOMER_ID/assets/-1)。
- 一个控制组 (
创建
AssetGroupAsset资源,将第 1 步中的测试资源 (customers/CUSTOMER_ID/assets/-1) 关联到实验组中使用的基础AssetGroup。
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!", ) 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 ) # 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, campaign_resource_name, 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
报告实验结果
如需查询 experiment 资源并比较对照组和实验组之间的指标,请参阅报告指南。
毕业或结束
评估结果后,您可以使用 ExperimentService 结束实验或将实验升级为正式版。
- 结束:如果您对实验组的结果不满意,请使用
EndExperiment。这是一项同步操作。 - 结束实验:如果您更喜欢实验组的素材资源组的效果,请使用
GraduateExperiment。在此过程中,与对照组相关联的原始基准广告系列会被暂停,而实验组会转换为新的独立广告系列。这是一项同步操作。