4.4 广告系列管理

简介


请务必让商家能够更改其广告系列 创建 Deployment他们应该能够改变的最重要的方面 如下:

  • 预算
  • 状态(暂停、启用、移除)
  • 地理位置定位(建议选择,但并非强制性要求)
  • 您在广告系列制作界面中包含的任何其他字段

用户体验指南


将广告系列列表作为 广告系列效果报告。允许用户暂停、删除和修改广告系列。

pmax_campaign

修改广告系列后,商家应能修改与其相同的字段 在制作广告系列时提供了相关信息。此示例说明了 如下所示:

edit_pmax

技术指南


制作零售专用效果最大化广告系列后,您可以更改 以下广告系列设置:

  • 广告系列名称
  • 广告系列预算
  • 广告系列状态
  • 广告系列定位条件

有关如何更改资源的详细概览,请参阅 开发者指南。您可以使用公开的 Service 对特定资源进行更改 端点(例如 CampaignService.MutateCampaigns),或者在多个不同的 使用批量转变功能提供的资源, GoogleAdsService.Mutate 端点。

如果可能,我们建议批量更改,以减少 更新广告系列所需的操作。考虑到这一点, 围绕使用 GoogleAdsService.Mutate 端点构建的架构 各个资源端点这样还可以更轻松地扩展 功能。

后面的示例假定您已将相关 ID 存储在本地 数据库。

广告系列名称

要更新广告系列的名称,您需要修改Campaign.name 字段。

不能包含任何 null(码位 0x0)、NL 换行符(码位 0xA) 或回车符(码位 0xD)字符。

广告系列预算

我们建议最好的做法是更新现有预算,而不是替换 并为其分配新的预算这可确保您的广告系列支出符合预期 不会导致超额投放

您应该只更新预算的值,而不应更改任何其他字段, 增加每日支出的价值。

Python
budget_resource_name = client.get_service(
        "CampaignBudgetService"
    ).campaign_budget_path(customer_id, budget_id)

mutate_operation = client.get_type("MutateOperation")
campaign_budget = mutate_operation.campaign_budget_operation.update

campaign_budget.resource_name = budget_resource_name

# update the budget amount to the new value

campaign_budget.amount_micros = 50000000

client.copy_from(
    mutate_operation.campaign_budget_operation.update_mask,
    protobuf_helpers.field_mask(None, campaign_budget._pb),
)
return mutate_operation

广告系列状态

要更新广告系列的状态(启用/暂停/移除),您需要将 Campaign.status 字段,然后在 CampaignStatus 枚举。

有关更改广告系列状态的示例,请参阅 更新广告系列

广告系列条件

更新广告系列标准时,您只需提供相应功能, 更新定位条件,这至少是地理位置定位 以及语言定位您可以找到 是针对 更新广告系列条件出价调节系数

要更新地理位置定位条件,请更新 CampaignCriterion.location 为新的地理位置定位常量的值。

Python
criterion_rname = client.get_service(
    "CampaignCriterionService"
    ).campaign_criterion_path(
    customer_id, campaign_id, criterion_id
)

mutate_operation = client.get_type("MutateOperation")
campaign_criterion = mutate_operation.campaign_criterion_operation.update

campaign_criterion.resource_name = criterion_rname

# Set the geo to the update geo targeting

campaign_criterion.location.geo_target_constant = (
   geo_target_constant_service.geo_target_constant_path("1022762")
) # Brooklyn

client.copy_from(
    mutate_operation.campaign_criterion_operation.update_mask,
    protobuf_helpers.field_mask(None, campaign_criterion._pb),
)
return mutate_operation

要更新语言定位标准,您需要更新 CampaignCriterion.language 值。

Python
campaign_criterion_service = client.get_service("CampaignCriterionService")

criterion_rname = campaign_criterion_service.campaign_criterion_path(
   customer_id, campaign_id, criterion_id
)

mutate_operation = client.get_type("MutateOperation")
campaign_criterion = mutate_operation.campaign_criterion_operation.update

campaign_criterion.resource_name = criterion_rname

# Set the language to the updated language
# For a list of all language codes, see:
# https://developers.google.com/google-ads/api/data/codes-formats#languages
campaign_criterion.language.language_constant = (
    googleads_service.language_constant_path("1000")
)  # English

client.copy_from(
    mutate_operation.campaign_criterion_operation.update_mask,
    protobuf_helpers.field_mask(None, campaign_criterion._pb),
)
return mutate_operation