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.
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.