Efficiency pulling reports for many clients - Adwords API vs Google Ads API (PHP)

78 views
Skip to first unread message

James Robinett

unread,
Sep 20, 2018, 12:18:33 PM9/20/18
to AdWords API and Google Ads API Forum
Hello,

TLDR version - is there a way to reuse the same Adwords session across multiple different client report downloads without rebuilding it?

Basically in this example: 

You need to rebuild the session for each pass of the loop through clients: 
// Construct an API session for the specified client customer ID. $session = $sessionBuilder->withClientCustomerId($customerId)->build();
With the new Google Ads API, you can pass the CustomerId in after the session/authentication has happened, during the actual query:
$response = $googleAdsServiceClient->search($customerId, $query, ['pageSize' => self::PAGE_SIZE]);
Doing a test run, downloading a simple campaign report for all our clients (over 1000), the old Adwords API takes over 1 hour, while the new Google Ads API takes around 20 minutes. I'm guessing there are several reasons for that but mainly it seems like having to rebuild the session for each client is a inefficient step. Is there anyway around that in the Adwords API as is?

I would love to use the new API to pull these reports but it doesn't support Gmail/Video campaigns yet, so we'll need to use the old one.

Thanks!

Dhanya Sundararaju (AdWords API Team)

unread,
Sep 20, 2018, 3:44:10 PM9/20/18
to AdWords API and Google Ads API Forum
Hi James,

In the ParallelReportDownload example, it is creating a session for the MCCid to be able to read all the accounts under it. Then, for each account, it is establishing a session in order to run a report against it. For each new client customer id, it has to create a session with the OAuth credentials as the reports work at a client customer id level. Please see this section of guide for better clarity. In your scenario, it is taking a long time as it is not supporting multithreading. The current report has to finish downloading before the next report is started. Please let me know if you have any further questions.

Regards,
Dhanya, AdWords API Team
Reply all
Reply to author
Forward
0 new messages