AI-generated Key Takeaways
-
Batch processing allows you to execute a series of interdependent operations across Google Ads services, including creating and managing Performance Max campaigns, without waiting for each operation to complete individually.
-
Creating a Performance Max campaign with batch processing involves preparing a list of
MutateOperation
objects, each defining a resource to be created or modified, such as an asset group or listing group filter. -
Operations involving
AssetGroup
andAssetGroupAsset
resources should be sequential within the batch job due to their interdependencies and asset requirements. -
When using
AssetGroupListingGroupFilter
for Performance Max campaigns with online sales, it's recommended to add operations targeting the sameAssetGroup
consecutively to ensure atomic processing. -
The batch job is executed asynchronously, requiring you to monitor its status using the
GetOperation
method until completion and then retrieve results usingListBatchJobResults
.
Batch processing provides a way to dispatch a set of operations, which may be interdependent, to multiple services without synchronously waiting for the operations to complete. You can use batch processing to create and manage Performance Max campaigns.
This guide provides details specific to Performance Max campaigns when working with batch processing. The generic batch processing guide provides general information about batch processing, and the Structure requests guide contains detailed information about constructing requests to create or manage Performance Max campaigns.
To create a Performance Max campaign using batch processing, follow these steps:
Create a new batch job
Follow the general batch processing job creation step for creating a BatchJob
resource.
Prepare a list of mutate operations
Performance Max campaigns require operations to create several related resources, which are detailed in the Structure requests guide. Create a MutateOperation
for each resource that should be included in the batch job.
CampaignOperation
and CampaignAssetOperation
requirements
When brand guidelines are enabled for a campaign (see brand guidelines), you must link brand assets to the campaign using CampaignAsset
resources. Furthermore, in a batch job the creation of these CampaignAsset
resources must happen immediately after the creation of the Campaign
resource itself. If the CampaignAsset
resources are not created immediately after the Campaign
resource (when brand guidelines are enabled - see troubleshooting), the request will fail and return a CampaignError
indicating missing assets. Including the CampaignAsset
creation operations later in the same list of operations won't prevent this error.
AssetGroupOperation
and AssetGroupAssetOperation
requirements
The operations of type MutateOperation
that create AssetGroup
and AssetGroupAsset
resources in a batch job must be sequential without other operations in between because of how these operations are grouped together when processed. Otherwise, the request throws an AssetGroupError
indicating some assets are missing, even if the operations required to meet minimum asset requirements are included later in the operations list.
AssetGroupListingGroupFilterOperation
best practices
When working with listing group filters in the context of an AssetGroupListingGroupFilter
, we recommend adding AssetGroupListingGroupFilterOperation
operations targeting the same AssetGroup
to a batch job consecutively, so that the set of operations are treated atomically during batch splitting. To read more on batch splitting and other factors affecting listing groups, see the listing group batch processing guide.
Add the mutate operations to the job
Add the mutate operations from Step 2 to a list and call AddBatchJobOperations
to add the list of mutations to the batch job created in Step 1. Follow the add operations step in the general batch processing guide to add the list of mutate operations.
Run the batch job
Allow the uploaded jobs to start running by calling RunBatchJob
. See Run the batch job step in the general batch processing guide for an example.
Retrieve the job's status
Batch jobs start as long-running operations and usually take time to finish. After starting the job, use the long-running operation's GetOperation
method to poll the job's status until it's done.
When all of your batch jobs finish, call ListBatchJobResults
to print their statuses and responses following the list all batch job results step in the general batch processing guide.