Get accounts associated to manager account in Google Ads API

66 views
Skip to first unread message

Tim

unread,
Apr 25, 2019, 8:34:43 AM4/25/19
to AdWords API and Google Ads API Forum
Given a manager account ID, how can I find the sub accounts this manager account is associated with?

In AdWords API there's the ManagedCustomerService but I cannot see an equivalent approach in Ads API.

Thanks

googleadsapi...@google.com

unread,
Apr 25, 2019, 9:54:30 AM4/25/19
to th...@post.com, AdWords API and Google Ads API Forum
Hi Tim,

You can use the CustomerClientService to get the accounts under your manager. 

For future reference, you can use this guide to see what services map from AdWords API to Google Ads API.

Cheers,
Anthony
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/8090ef98-98e9-4c72-b77d-055df67bddbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tim

unread,
Apr 25, 2019, 10:13:44 AM4/25/19
to AdWords API and Google Ads API Forum
Hi Anthony,

Thank you for the help.

I'm a little confused on how to use the CustomerClientService. 

Firstly to get the service should I be doing this with a GoogleAdsClient  that has login customer ID set to the manager account ID?
Then, how do I use the service to determine if a given account is a sub account of the manager account?

I have got this far, but not sure what do with the CustomerClient from here:

CustomerClient client = googleAdsClient.getLatestVersion().createCustomerClientServiceClient()
.getCustomerClient(managerCustomer.getResourceName());


Thanks

va...@adcore.com

unread,
Apr 25, 2019, 10:16:59 AM4/25/19
to AdWords API and Google Ads API Forum
Hi Anthony,

I'm wondering that you have an mistake in explanation.
Using CustomerClientService possible just to retrieve only one CustomerClient.
In order to retrieve all CustomerClients need to use GoogleAdsService.Search for CustomerClient.
SELECT customer_client.resource_name, customer_client.client_customer, customer_client.level, customer_client.hidden FROM customer_client

googleadsapi...@google.com

unread,
Apr 25, 2019, 11:12:37 AM4/25/19
to va...@adcore.com, AdWords API and Google Ads API Forum
Hi Tim,

You can use the query that Vadim mentioned to get your client accounts. The field level will give you the distance between given customer and client.

Regards,
Anthony
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Reply all
Reply to author
Forward
0 new messages