Get MCC ids along with customers

34 views
Skip to first unread message

dhmitc...@gmail.com

unread,
Jan 3, 2023, 3:11:35 PM1/3/23
to Google Ads API and AdWords API Forum
We have a nested MCC structure w hundreds of "customers" (aka accounts). I'd like to get the mcc id for each customer. I don't want the "logged in" customer id but instead the direct owning mcc id for each so I can ensure the remote structure complies with our business structure. (Our mcc ids, of course, repr different business segments.)

Currently the query looks like:

SELECT customer_client.id, customer_client.resource_name, customer_client.test_account,
      customer_client.descriptive_name, customer_client.currency_code, 
      customer_client.time_zone, customer_client.status
FROM customer_client
WHERE customer_client.hidden = false and customer_client.manager = false
     and customer_client.test_account = false and customer_client.status = 'ENABLED'"

I was hoping customer_client.resource_name would be customers/{mcc}/customerClients/{customer_id} but it just duplicates the customer_id into both fields.

Don Mitchell
Sr. Princ. SW Arch
CarGurus

dhmitc...@gmail.com

unread,
Jan 3, 2023, 3:21:31 PM1/3/23
to Google Ads API and AdWords API Forum
ah, looks like https://developers.google.com/google-ads/api/docs/account-management/get-account-hierarchy shows to do it by recursion one layer at a time. That should work for me. Sorry for not finding this before posting.

Google Ads API Forum Advisor

unread,
Jan 3, 2023, 3:48:45 PM1/3/23
to dhmitc...@gmail.com, adwor...@googlegroups.com
Hi Don,

Thanks for reaching out. Good to see you found the Get Account Hierarchy documentation. Please let us know if you have any questions about this example.

Thanks,

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2hZD0y:ref
Reply all
Reply to author
Forward
0 new messages