Tuesday, September 19, 2023

Performance Max: create listing groups using batch processing

What’s New

Starting on October 4, 2023, AssetGroupListingGroupFilters can be created asynchronously using batch processing with the Google Ads API. If you use BatchJobService to create AssetGroupListingGroupFilter entities and other Performance Max resources in a single request, errors in the listing group tree creation will not block the creation of the remaining entities. However, the operations to create a listing group tree will still be atomic. This means that if any operation related to the creation of a listing group tree returns an error, all operations related to that listing group tree will also fail, save a few caveats, which are detailed in this Jobs & listing group filters guide.

This update does not change the behavior of any existing batch jobs that do not include operations that create listing group filters.

Previous Behavior

Prior to October 4, 2023, AssetGroupListingGroupFilters could only be created synchronously using the GoogleAdsService.Mutate or AssetGroupListingGroupFilterService.MutateAssetGroupListingGroupFilters method. Requests using the GoogleAdsService.Mutate method are always atomic when they contain AssetGroupListingGroupFilterOperation operations. This is because partial_failure is not supported for these operations, which means that an error in listing group tree creation would block all other operations in the request. If you tried creating AssetGroupListingGroupFilter entities prior to October 4, 2023 using batch processing, you would receive a MutateError.OPERATION_DOES_NOT_SUPPORT_PARTIAL_FAILURE error.

Change Rationale

Batch processing is a powerful feature in the Google Ads API that allows you to dispatch a set of operations, which may be interdependent, to multiple services without synchronously waiting for the operations to complete. We have made batch processing available for AssetGroupListingGroupFilters in response to your feedback to provide another option for creating listing group trees asynchronously and without blocking other operations in the same request.

Implementation Details

In order to add an AssetGroupListingGroupFilter using a batch job:

  1. Create a MutateOperation containing an AssetGroupListingGroupFilterOperation. This is no different than creating a MutateOperation using the GoogleAdsService.Mutate service.
  2. Add the MutateOperation to the batch job as you would with any other type of operation.

The example below demonstrates the process of adding a single AssetGroupListingGroupFilter to an existing batch job. See the Creating Shopping Listing Groups guide to learn more about creating product partition trees using AssetGroupListingGroupFilter entities.

// Constructs the AssetGroupListingGroupFilter.
AssetGroupListingGroupFilter listingGroupFilter =
     AssetGroupListingGroupFilter.newBuilder()
         .setAssetGroup(assetGroupResourceName)
         .setType(ListingGroupFilterType.UNIT_INCLUDED)
         .setVertical(ListingGroupFilterVertical.SHOPPING)
         .build();

// Constructs the operation to create the AssetGroupListingGroupFilter.
MutateOperation operation = MutateOperation.newBuilder()
     .setAssetGroupListingGroupFilterOperation(
           AssetGroupListingGroupFilterOperation
      .newBuilder()
      .setCreate(listingGroupFilter))
      .build();

// Sends a request to add the operation to the batch job.
AddBatchJobOperationsResponse response =
    batchJobServiceClient.addBatchJobOperations(
        AddBatchJobOperationsRequest.newBuilder()
            .setResourceName(batchJobResourceName)
            .addMutateOperations(operation)
            .build());

The following resources contain additional information to help you with your integration:

Improving Performance Max integrations Blog Series

This article is part of a series that discusses new and upcoming features that you have been asking for. We’ll cover what’s new and how it differs from the current implementation approach.

Keep an eye out for further updates and improvements on our developer blog, continue providing feedback on Performance Max integrations with the Google Ads API, and as always, contact our team if you need support.