若要从头开始制作新的效果最大化广告系列,您至少必须创建以下内容:
广告系列和预算对于制作各种类型的广告系列都很有用,而与素材资源相关的操作对于制作效果最大化广告系列尤其有用。
请确保您熟悉更改策略,因为本指南仅提供要在更改中使用的 JavaScript 对象。
预算
该预算不得共享,且必须在您的账号中具有唯一的名称。使用 CampaignBudgetOperation
。
const budgetOperation = {
"campaignBudgetOperation": {
"create": {
"resourceName": `customers/${customerId}/campaignBudgets/${getNextTempId()}`,
"name": "Performance Max campaign budget",
"amountMicros": "50000000",
"deliveryMethod": "STANDARD",
"explicitlyShared": false
}
}
}
operations.push(budgetOperation);
广告系列
广告系列必须引用之前创建的预算,因此除了使用临时 ID 指定自己的资源名称之外,您还需要使用在上一步中设置的确切资源名称来创建广告系列,以便您能够唯一地识别在此请求中之前创建的预算。使用 CampaignOperation
。
const campaignOperation = {
"campaignOperation": {
"create": {
"resourceName": `customers/${customerId}/campaigns/${getNextTempId()}`,
"name": "Performance Max campaign",
"status": "PAUSED",
"advertisingChannelType": "PERFORMANCE_MAX",
"campaignBudget": budgetOperation.campaignBudgetOperation.create.resourceName,
"biddingStrategyType": "MAXIMIZE_CONVERSION_VALUE",
"startDate": "20240314",
"endDate": "20250313",
"urlExpansionOptOut": false,
"maximizeConversionValue": {
"targetRoas": 3.5
}
}
}
}
operations.push(campaignOperation);
素材资源组
此广告系列的素材资源组需要引用该广告系列,并且您日后将素材资源关联到该素材资源组时也需要引用该广告系列。使用 AssetGroupOperation
。
const assetGroupOperation = {
"assetGroupOperation": {
"create": {
"resourceName": `customers/${customerId}/assetGroups/${getNextTempId()}`,
"campaign": campaignOperation.campaignOperation.create.resourceName,
"name": "Performance Max asset group",
"finalUrls": [
"http://www.example.com"
],
"finalMobileUrls": [
"http://www.example.com"
],
"status": "PAUSED"
}
}
}
operations.push(assetGroupOperation);
素材资源组链接
现在,您已经有了素材资源组和素材资源(来自上一步),接下来需要将它们关联起来,以便效果最大化广告系列知道您要使用哪些素材资源。您必须在最初创建素材资源组时进行此操作。为此,请使用 AssetGroupAssetOperation
。
您需要提供正确的素材资源名称,并将 fieldType
修改为要关联的素材资源的适当值。查看有效字段类型的完整列表。
您需要执行多次此类操作,才能满足效果最大化广告系列的最低要求。
operations.push({
"assetGroupAssetOperation": {
"create": {
"assetGroup": assetGroupOperation.assetGroupOperation.create.resourceName,
// assetResourceName here is a placeholder; you will need to determine
// the correct resource name to use depending on which asset you want
// to add to the asset group.
"asset": assetResourceName,
"fieldType": "HEADLINE"
}
}
});