如需从头开始生成新的效果最大化广告系列,您至少必须创建以下内容:
广告系列和预算可用于创建各种广告系列类型,而与素材资源相关的操作对于创建效果最大化广告系列尤其有用。如需了解如何使用脚本创建素材资源,请参阅效果最大化广告系列素材资源指南,了解 详情。
请务必熟悉 mutate 策略,因为本指南仅 提供要在 mutates 中使用的 JavaScript 对象。
预算
预算不得共享,且在您的账号中必须具有唯一的名称。请使用
a 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"
}
}
});