Google AdWords API Asynchronous Workflow Solution DetailedBy: Zach Walton - April 4, 2012
Google designed the AdWords API to handle a large number of operations in one request. The only problem is that current API services are synchronous. What this means is that the client has to send a request to the server, wait for processing and then receive a result. Google has added some changes to speed up the service.
The Google Ads Developer blog today Google+Ads+Developer+Blog%29″>explained how the relatively new MutateJobService works with the AdWords API. The service’s main benefit is that it offers an asynchronous workflow. The benefits of using the new service are detailed below:
No need to manage connections for each job – the job is executed autonomously and the results can be retrieved when ready.
Multiple jobs can be submitted and executed in parallel. In fact, the service has no limit on the maximum jobs count.
Transient errors like ‘CONCURRENT_MODIFICATION’ are automatically retried with no extra requests necessary.
Workload is automatically balanced so you will never receive a ‘RateExceededError’ error.
If that doesn’t convince you to switch over to the MJS service, perhaps a reduction in cost will. Google says that using MJS operations cost only about 50 percent of usual operations units cost.
If you are using the old BulkMutateJobService, you can replace existing calls with the new MJS service. Google says that you can just the same operations array to submit a job and it will take care of the rest. You can see implementation examples on the blog post for Java, PHP, Perl, DotNet, Ruby and Python.
Google recommends that developers not poll for job status too often as it results in a RATE_EXCEEDED_ERROR error. They say you should pause for five to 30 seconds between get requests.
MJS jobs have no minimum number of operations, but the team recommends that you at least send 100 operations per job. There is a maximum number of jobs, however, but it’s at a generous 10,000 operations per job.
As a final recommendation, developers should try to group operations in a way that minimizes the number of different AdGroups in one job.
If you need more visual examples of how MJS works, Google recorded a talk given at an AdWords workshop event that explains how MJS can be applied. Check it out to see if MJS is the right fit for your AdWords campaign.