Batch Job best practice

68 views
Skip to first unread message

Nikola Jordanovski

unread,
Jan 25, 2016, 2:43:55 PM1/25/16
to AdWords API Forum
Hello AdWords API team,

so the system that i am developing turned out to require huge pile of data to be calculated and then stored in our database in form of a :
Ad Group , Ad etc.
Now my current logic is to prepare the ad groups, ads and keywords locally first under our internal calculations.
Group them and send a BatchJob to make them real ( create ad groups,ads etc ).
its working fine, but the huge problem that i have is my trackback to update my local database when ad group or ad its created.
My Temporary ID's are my database ID's, example:

ID:123 ( -123 is my temp id )
headline:Hello World
desc1 : Hello World api
desc2 : Hello World Api 2
displayUrl : Test.com
finalUrl : https://test.com

now after a success on the batch job, i get the results back, but since my temporary id is missing i can't seem to write in my database as : This Ad Group is a success

Any suggestions?

Thanks!
Nick

Ilya Isakov

unread,
Jan 25, 2016, 2:56:34 PM1/25/16
to AdWords API Forum
Hello Nick,

I'm not from Adwords API Team but try to answer on your question.

Every mutateResult contains index which correlate with number of operation in upload. 

You can save locally temporary ids for each operation in the same sequence as it was in upload. That allows you to match Adword's id from result with your temporary id by index of operation.

You can find information about that in official documentation here: https://developers.google.com/adwords/api/docs/guides/batch-jobs .

The only problem is that sometimes batch job completes with different number of operations in result file. In this case indexes are messed and you shouldn't use them because there is no way to match them correctly. I've raised question about that for Adwords API Team here: https://groups.google.com/forum/?hl=ru#!searchin/adwords-api/Batchjob/adwords-api/5tpsDXXxjw8/qCw1p1VkEgAJ . Still waiting for response.

Also there is an issue with CANCELED status of batch job: https://groups.google.com/forum/?hl=ru#!searchin/adwords-api/Batchjob/adwords-api/SsWFurDlXx0/Or-uFyIxEgAJ . In this case Adwords could create object on it's side but don't return any data in response.

Best regards,
Ilya


понедельник, 25 января 2016 г., 22:43:55 UTC+3 пользователь Nikola Jordanovski написал:
Reply all
Reply to author
Forward
0 new messages