How to list all accounts when multiple MCC accounts are under a single account.

104 views
Skip to first unread message

Charles Bannister

unread,
Apr 1, 2019, 6:53:11 AM4/1/19
to AdWords API and Google Ads API Forum
Hi, 

When I run the python example code "Get the account hierarchy under the current account" it works for ordinary MCC accounts. Great. 

However, I have an account which, when I log in, I first choose which linked MCC account to access. 

In that account, no cigar. It lists some accounts but not all. 

I imagine I need to go deeper, and that has something to do with the "links" part of what's been returned but I can't figure it out.

Any help would be appreciated. 

Thanks

Marc Selman

unread,
Apr 1, 2019, 8:18:39 AM4/1/19
to AdWords API and Google Ads API Forum
Hi Charles,

I've built this functionality as wel. There's no way to retrieve all information in one request.
You'll need to loop through each customer and check if there are customers below that one etc.

1) Query all customers
2) Loop through each customer (here you can also store if the customer is a manager or a test account)

3) Query all customer-client-links for the customer (check for the active status)
4) Loop through all the links (here you can also store if the link represents a hidden customer)
5) Query the customer resource using the id in the link (here you can also store if the customer is a manager or a test account)
6) Back to step 3 for the current customer

So the part from step 3 will be a recursive function.

I hope this helps.

Best regards,
Marc Selman

Op maandag 1 april 2019 12:53:11 UTC+2 schreef Charles Bannister:

Charles Bannister

unread,
Nov 22, 2019, 3:48:34 PM11/22/19
to AdWords API and Google Ads API Forum
Marc,

Apologies for the delay and thanks for the info. I'm just getting back round to this now and it's a big help thank you. 

Charles
Reply all
Reply to author
Forward
0 new messages