创建需求开发订单项

需求开发订单项可在 Google 最具影响力的各个平台(包括 YouTube、Google 探索、Gmail 和 Google 展示广告网络)上投放多种格式的广告组和广告。需求开发广告订单项与其他类型的订单项一样,使用 LineItem 资源进行管理,并根据设定的预算、出价策略和定位条件来运作。demandGenSettings 字段中还提供了一些特定于需求开发广告订单项的设置。

需求开发订单项具有名为广告组的子资源。广告组可在各个订单项下提供另一层级的控制。

选择配置

在创建需求开发广告订单项之前,请查看并确定相关设置。

对于需求开发订单项:

  • lineItemType 必须设置为 LINE_ITEM_TYPE_DEMAND_GEN
  • 必须使用 BiddingStrategy 对象的 demandGenBid 字段设置 bidStrategy
  • budget 必须在订单项级别设置为固定金额,不能从父广告订单沿用。
  • demandGenSettings 用于设置特定于需求开发广告系列订单项的配置。DemandGenSettings 对象的 geoLanguageTargetingEnabled 字段用于控制地理位置和语言定位条件是在订单项级设置还是在各个广告组中设置。创建订单项后,此字段便无法更新。如果您希望在订单项级配置此定位条件,请将相应字段设置为 true
  • 不应设置 creativeIds。素材资源直接在 AdGroupAd 资源中分配和配置。

以下字段是需求开发广告系列订单项的必填字段,其运作方式与其他类型的订单项相同:

LineItem 资源还有许多可选字段,可以进行设置。如需了解详情,请参阅参考文档

创建订单项

以下示例展示了如何使用以下设置创建需求开发广告订单项:

  • 继承的排期和 100 美元的预算。
  • 合作伙伴收入模式为总媒体费用的 0.1%。
  • 一种以实现每次转化的平均费用为 10 美元为目标进行优化的出价策略。
  • 用于指定是将地理位置和语言定位直接分配给订单项下的广告组,还是分配给订单项本身的偏好设置。

Python

# Provide the ID of the parent advertiser.
advertiser_id = advertiser-id

# Provide the ID of the parent insertion order.
insertion_order_id = insertion-order-id

# Provide the display name of the line item.
display_name = display-video

# Provide the Floodlight activity ID to use for conversion tracking.
floodlight_activity_id = floodlight-activity-id

# Provide whether the line item will serve EU political ads.
contains_eu_political_ads = contains-eu-political-ads

# Create a line item object with example values.
line_item_obj = {
    "insertionOrderId": insertion_order_id,
    "displayName": display_name,
    "lineItemType": "LINE_ITEM_TYPE_DEMAND_GEN",
    "entityStatus": "ENTITY_STATUS_DRAFT",
    "flight": {"flightDateType": "LINE_ITEM_FLIGHT_DATE_TYPE_INHERITED"},
    "budget": {
        "budgetAllocationType": "LINE_ITEM_BUDGET_ALLOCATION_TYPE_FIXED",
        "maxAmount": 100000000
    },
    "pacing": {
        "pacingPeriod": "PACING_PERIOD_FLIGHT",
        "pacingType": "PACING_TYPE_EVEN",
        "dailyMaxMicros": 10000,
    },
    "partnerRevenueModel": {
        "markupType": (
            "PARTNER_REVENUE_MODEL_MARKUP_TYPE_TOTAL_MEDIA_COST_MARKUP"
        ),
        "markupAmount": 100,
    },
    "bidStrategy": {
        "demandGenBid": {
            "type": "DEMAND_GEN_BIDDING_STRATEGY_TYPE_TARGET_CPA",
            "value": "10000000"
        }
    },
    "conversionCounting": {
        "postViewCountPercentageMillis": "100000",
        "floodlightActivityConfigs": [
            {
                "floodlightActivityId": floodlight_activity_id,
                "postClickLookbackWindowDays": 90,
                "postViewLookbackWindowDays": 90
            }
        ]
    },
    "containsEuPoliticalAds": contains_eu_political_ads,
    "demandGenSettings": {
        "geoLanguageTargetingEnabled": False
    }
}

# Build and execute request.
response = (
    service.advertisers()
    .lineItems()
    .create(advertiserId=advertiser_id, body=line_item_obj)
    .execute()
)

# Display the new line item.
print(f"Demand Gen line Item {response['name']} was created.")