素材资源优化实验

素材资源优化实验用于测试效果最大化广告系列中的不同素材资源组合,让您可以比较不同素材资源组相对于基准素材资源组的效果。

此工作流支持 ExperimentType.OPTIMIZE_ASSETS

设置

如需设置素材资源优化实验,请执行以下操作:

  • 创建一个新素材资源,即包含对照组和实验组的实验。
  • 将新素材资源关联到实验组的素材资源组,所有操作都在单个 mutate 请求中完成。

由于这些实体相互依赖,因此您必须使用临时资源 名称来引用 在同一请求中较早的操作中创建的资源。

请求中的操作必须按以下顺序进行:

  1. 使用临时资源名称 (例如 customers/CUSTOMER_ID/assets/-1)创建 Asset。这将是您的测试素材资源。
  2. 使用临时资源 名称(例如 customers/CUSTOMER_ID/experiments/-2)创建 Experiment
  3. 创建两个 ExperimentArm 资源:
    • 一个与基准 AssetGroup 相关联的对照组。
    • 一个与同一基准 AssetGroup 相关联的实验组。在此实验组中,使用在第 1 步中创建的素材资源的临时资源名称设置 asset_groups 字段。
  4. 创建一个 AssetGroupAsset,将第 1 步中的素材资源关联到实验组中使用的素材资源组。

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 提供素材资源优化实验报告,以比较对照组和实验组素材资源 组之间的指标。experiment

结业或结束

评估结果后,您可以使用 ExperimentService 结束实验或让实验结业。

  • 结束:如果您对实验组的结果不满意, 请使用 EndExperiment。这是一项同步操作。
  • 升级:如果您更喜欢实验组素材资源 组的效果,请使用 GraduateExperiment。在此过程中,与对照组关联的原始基准广告系列会被暂停,实验组会转换为新的独立广告系列。这是一项同步操作。