素材資源最佳化實驗

素材資源最佳化實驗可用於測試最高成效廣告活動中的不同素材資源組合,比較不同素材資源組合與基準組合的成效。

這項工作流程支援 ExperimentType.OPTIMIZE_ASSETS

設定

如要設定素材資源最佳化實驗,請按照下列步驟操作:

  • 建立新的素材資源,以及包含控制組和實驗組的實驗。
  • 將新素材資源連結至實驗組的素材資源群組,所有作業都在單一變動要求中完成。

由於這些實體相互依存,您必須使用暫時資源名稱,才能在同一項要求中參照先前作業建立的資源。

要求中的作業必須依下列順序排列:

  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

實驗報表

您可以使用 experiment 資源,製作素材資源最佳化實驗的報表,比較控制組和實驗組素材資源群組的指標。

畢業或結束

評估結果後,您可以使用 ExperimentService 結束或完成實驗。

  • 結束:如果對實驗組的結果不滿意,請使用 EndExperiment。這項作業是同步作業。
  • 畢業:如果偏好實驗組素材資源群組的成效,請使用 GraduateExperiment。在此過程中,系統會暫停與控制組相關聯的原始基礎廣告活動,並將實驗組轉換為新的獨立廣告活動。這項作業是同步作業。