如需从头开始生成新的效果最大化广告系列,您至少必须创建以下内容:
广告系列和预算对于制作各种类型的广告系列都非常有用,而与素材资源相关的操作则特别有助于制作效果最大化广告系列。请访问效果最大化广告系列素材资源指南,了解如何使用脚本制作素材资源。
请务必熟悉变异策略,因为本指南仅提供要在变异中使用的 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);
广告系列
广告系列必须引用预算,因此您需要使用在上一步中创建的确切预算资源名称来识别和使用该特定预算对象。使用 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
},
"containsEuPoliticalAdvertising": false
}
}
}
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"
}
}
});