素材资源优化实验会测试效果最大化广告系列中的不同素材资源组合,以便您比较不同素材资源组与基准组的效果。
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。 创建两个
ExperimentArm资源,并将其关联到第 2 步中的临时实验资源名称,在每个实验组中设置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
# 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.operation.mutate do |m| m.experiment_operation = client.operation.create_resource.experiment do |e| e.resource_name = client.path.experiment(customer_id, experiment_temp_id) e.name = "Interstellar Asset Experiment #{(Time.new.to_f * 1000).to_i}" e.type = :OPTIMIZE_ASSETS # Set the optimize assets experiment subtype to COMPARE_ASSETS. e.optimize_assets_experiment = client.resource.optimize_assets_experiment_info do |oae| oae.optimize_assets_experiment_subtype = :COMPARE_ASSETS end end end # 3. Create two ExperimentArm resources. treatment_assets = [ [asset_1_temp_id, :HEADLINE], [asset_2_temp_id, :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, :HEADLINE, ) asset_group_asset_operation_2 = create_asset_group_asset_operation( client, customer_id, asset_group_id, asset_2_temp_id, :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 = client.service.google_ads.mutate( customer_id: customer_id, mutate_operations: mutate_operations, )
Perl
This example is not yet available in Perl; you can take a look at the other languages.
curl
报告实验结果
请参阅报告指南,查询 experiment 资源并比较对照组和实验组素材资源组之间的指标。
毕业或结束
评估结果后,您可以使用 ExperimentService 结束或毕业实验。
- 结束:如果您对实验组的结果不满意,请使用
EndExperiment。这是一项同步操作。 - 结业:如果您更喜欢实验组素材资源组的效果,请使用
GraduateExperiment。在此过程中,与对照组关联的原始基准广告系列会被暂停,实验组会转换为新的独立广告系列。 这是一项同步操作。