如需从头开始生成新的效果最大化广告系列,您必须至少创建以下内容:
广告系列和预算可用于制作各种类型的广告系列,而与素材资源相关的操作则专门用于制作效果最大化广告系列。请访问效果最大化广告系列素材资源指南,了解如何使用脚本创建素材资源。
请确保您熟悉更改策略,因为本指南仅提供要在更改中使用的 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": "DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING"
}
}
}
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"
}
}
});