廣告活動內實驗

廣告活動內實驗用於測試單一廣告活動的特定功能。與系統管理的實驗不同,系統管理的實驗會將流量分配給控制組和實驗組廣告活動,而廣告活動內實驗會根據功能是否啟用,在廣告活動內分配流量。

這項工作流程支援下列 ExperimentType 值:

  • ADOPT_AI_MAX
  • ADOPT_BROAD_MATCH_KEYWORDS

設定

  1. 定義 Experiment,提供實驗類型、控制組ExperimentArm和實驗組ExperimentArm。每個實驗組都應參照同一個廣告活動。
  2. 使用欄位遮罩,為實驗啟用測試功能。ADOPT_BROAD_MATCH_KEYWORDS不必這麼做;建立實驗後,系統會自動啟用廣泛比對廣告活動設定。
  3. 傳送 GoogleAdsService.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。這會將實驗變更套用為廣告活動的新永久狀態。這是一項非同步作業,詳情請參閱「非同步錯誤」。

廣告活動內實驗不支援「定案」作業,因為沒有可定案的獨立實驗組廣告活動。