广告系列内实验

广告系列内实验用于测试单个广告系列的特定功能。与系统管理的实验(在对照组广告系列和实验组广告系列之间分配流量)不同,广告系列内实验会根据相应功能是否已启用,在广告系列分配流量。

此工作流支持以下 ExperimentType 值:

  • ADOPT_AI_MAX
  • ADOPT_BROAD_MATCH_KEYWORDS

设置

  1. 定义 Experiment,提供实验类型、对照组 ExperimentArm 和实验组 ExperimentArm。每个实验组都应引用同一广告系列。
  2. 使用字段掩码为实验启用测试功能。对于 ADOPT_BROAD_MATCH_KEYWORDS无需执行此操作;相反,系统会在创建实验时自动启用广泛匹配广告系列设置。
  3. 发送 GoogleAdsService.Mutate 请求,其中包含用于创建实验和实验组的 mutate 操作,以及(如果适用)用于启用测试功能的 mutate 操作。

设置完成后,系统会在广告系列内分配流量,使 50% 的流量会看到已启用的功能(实验组),而 50% 的流量不会看到(对照组)。

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

# Create the experiment resource name using a temporary ID.
experiment_resource_name = googleads_service.experiment_path(
    customer_id, "-1"
)

# Create the experiment.
experiment_operation = client.get_type("MutateOperation")
experiment = experiment_operation.experiment_operation.create
experiment.resource_name = experiment_resource_name
experiment.name = f"ADOPT_AI_MAX Experiment #{uuid4()}"
experiment.type_ = client.enums.ExperimentTypeEnum.ADOPT_AI_MAX
experiment.status = client.enums.ExperimentStatusEnum.SETUP

# Create the control arm. Both arms in an intra-campaign experiment
# reference the same base campaign.
control_arm_operation = client.get_type("MutateOperation")
control_arm = control_arm_operation.experiment_arm_operation.create
control_arm.experiment = experiment_resource_name
control_arm.name = "Control Arm"
control_arm.control = True
control_arm.traffic_split = 50
control_arm.campaigns.append(
    googleads_service.campaign_path(customer_id, campaign_id)
)

# Create the treatment arm.
treatment_arm_operation = client.get_type("MutateOperation")
treatment_arm = treatment_arm_operation.experiment_arm_operation.create
treatment_arm.experiment = experiment_resource_name
treatment_arm.name = "Treatment Arm"
treatment_arm.control = False
treatment_arm.traffic_split = 50
treatment_arm.campaigns.append(
    googleads_service.campaign_path(customer_id, campaign_id)
)

# Create a campaign operation with an update mask to enable AI Max and
# configure asset automation settings.
campaign_operation = client.get_type("MutateOperation")
campaign = campaign_operation.campaign_operation.update
campaign.resource_name = googleads_service.campaign_path(
    customer_id, campaign_id
)
campaign.ai_max_setting.enable_ai_max = True

for asset_automation_type_enum in [
    client.enums.AssetAutomationTypeEnum.TEXT_ASSET_AUTOMATION,
    client.enums.AssetAutomationTypeEnum.FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION,
]:
    asset_automation_setting = client.get_type(
        "Campaign"
    ).AssetAutomationSetting()
    asset_automation_setting.asset_automation_type = (
        asset_automation_type_enum
    )
    asset_automation_setting.asset_automation_status = (
        client.enums.AssetAutomationStatusEnum.OPTED_IN
    )
    campaign.asset_automation_settings.append(asset_automation_setting)

client.copy_from(
    campaign_operation.campaign_operation.update_mask,
    protobuf_helpers.field_mask(None, campaign._pb),
)

# Send all mutate operations in a single Mutate request.
mutate_operations = [
    experiment_operation,
    control_arm_operation,
    treatment_arm_operation,
    campaign_operation,
]

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

报告实验结果

由于对照组流量和实验组流量混合在单个广告系列中,因此您必须使用直接实验报告来比较对照组和实验组之间的指标。标准广告系列级报告仅显示整个广告系列的汇总指标,无法区分这两个组。

以下 GAQL 查询可用于检索 ADOPT_AI_MAX 广告系列内实验的点击统计信息。

SELECT
  experiment.resource_name,
  experiment.name,
  metrics.clicks,
  metrics.control_clicks,
  metrics.clicks_point_estimate,
  metrics.clicks_p_value
FROM experiment
WHERE experiment.type = 'ADOPT_AI_MAX'

应用或结束实验

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

  • 结束:如果您对结果不满意,请使用 EndExperiment。该功能将被停用,广告系列将恢复为针对所有流量投放,而不再使用实验性功能。这是一项同步操作。
  • 升级:如果您对结果感到满意,请使用 PromoteExperiment。 这会将实验性更改作为广告系列的新永久状态应用。这是一项异步操作;如需了解详情,请参阅异步错误

由于没有单独的实验组广告系列可供转正,因此广告系列内实验不支持转正操作。