How to retrieve all accounts under MCC

40 views
Skip to first unread message

ag.apite...@gmail.com

unread,
Jan 23, 2018, 4:53:46 AM1/23/18
to AdWords API Forum

Hi,
I'd like to retrieve all Accounts under MCC and campaigns of the each Account. 
As a start point, I run GetAccountHierarchy.php file in order to get all test clients . It works fine if I change the client Id to manager id in adsapi_php.ini file, but then when I run the getCampaign.php file for example, I got an error. 

Could you please help me to find solution about this issue?

Thank you very much for your time.

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Jan 23, 2018, 11:57:39 AM1/23/18
to AdWords API Forum
Hi,

You are in the right direction. To get all the accounts under an MCC hierarchy, you can use the ManagedCustomerService.get() as shown in code sample GetAccountHierarchy. To perform a CampaingService.get() on each of the client accounts under that MCC, you can build the session with that clientCustomerId on the runtime as in ParallelReportDownload sample. The sample is for downloading an ad-hoc report from all the client accounts under one MCC. You will need to modify the code to perform CampaingService.get() instead. By doing this, you will not have to change the clientCustomerId in the adsapi_php.ini file while making the get campaigns API call. 

Thanks,
Sreelakshmi, AdWords API Team

ag.apite...@gmail.com

unread,
Jan 24, 2018, 5:44:45 AM1/24/18
to AdWords API Forum
Thank you so much for your help!
Best Regards.



Reply all
Reply to author
Forward
0 new messages