Google Ads published new guides on creating Performance Max campaigns in Google Ads scripts using the mutate function. This function provides access to most features of the full Google Ads API, enabling the automation of various tasks. Performance Max campaigns unify all Google Ads channels and inventory, optimizing performance and reducing management complexity by dynamically allocating budgets to high-performing channels like Search, YouTube, Display, Discover, Gmail, and Maps.
How to create a Performance Max campaign using Google Ads scripts
To create a Performance Max campaign using Google Ads scripts, follow these steps:
Create a Budget:
const budgetOperation = { "campaignBudgetOperation": { "create": { "resourceName": `customers/${customerId}/campaignBudgets/${getNextTempId()}`, "name": "Performance Max campaign budget", "amountMicros": "50000000", "deliveryMethod": "STANDARD", "explicitlyShared": false } } }; operations.push(budgetOperation);
Create the Campaign:
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);
Create an Asset Group:
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);
Link Assets to Asset Group:
operations.push({ "assetGroupAssetOperation": { "create": { "assetGroup": assetGroupOperation.assetGroupOperation.create.resourceName, "asset": assetResourceName, "fieldType": "HEADLINE" } } });
Execute All Operations:
AdsApp.mutateAll(operations);
These steps ensure that you create a Performance Max campaign with the necessary components and link them appropriately.