customer hierarchy with CustomerManagerLink and CustomerClientLink.

170 views
Skip to first unread message

Anand Sumo

unread,
Feb 7, 2019, 1:38:34 PM2/7/19
to AdWords API and Google Ads API Forum
How do I get customer hierarchy by using Google ads API? (in DotNet)

googleadsapi...@google.com

unread,
Feb 7, 2019, 5:44:22 PM2/7/19
to AdWords API and Google Ads API Forum
Hello,

To get the account hierarchy via Google Ads API beta, you could use the customer_client resource. Through which you can get only the resource name, level, Boolean value of hidden status and Client_customer details of the accounts under your manager account. To get these details the OAuth credentials used to make the API call should be of manager account and the CleintCustomerId passing in the header should be of manager account. Below is the sample query for your reference.

Query in DotNet format below:
Query = @"SELECT
              customer_client.resource_name,
              customer_client.client_customer,
              customer_client.level, customer_client.hidden,
              customer_client.level
              FROM customer_client",
              CustomerId = customerId.ToString() 

Please let me know if you have any further questions.

Regards,
Sai Teja, Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Anand Sumo

unread,
Feb 8, 2019, 5:16:30 AM2/8/19
to AdWords API and Google Ads API Forum
Hi can we get the "DescriptiveName" in same Query?

googleadsapi...@google.com

unread,
Feb 8, 2019, 1:52:40 PM2/8/19
to AdWords API and Google Ads API Forum
Hello Anand,

Descriptive name for the customer is not available in the customer_client resource. You have to make another API call to the customer resource. You could use the available customer fields in the customer resource and can pass each customer Id to get the respective details of that customer. Below is the sample search query to fetch the customer details via customer resource.

Query in DotNet format given below:
Query = @"SELECT
                  customer.resource_name,
                  customer.descriptive_name,
                  customer.id
                  customer.test_account,
                  customer.tracking_url_template FROM customer",
                  CustomerId = customerId.ToString() //Pass the customer Id that you found on the resource name earlier.

Please let me know if you have any further questions.

Regards,
Sai Teja, Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

he...@websavvy.com.au

unread,
Mar 5, 2019, 10:08:13 AM3/5/19
to AdWords API and Google Ads API Forum
Is there a way to get the descriptive_names without making a separate call for each customer_client? I have approximately 200 client accounts under a manager account, and that's a lot of API calls to get the names of them.

googleadsapi...@google.com

unread,
Mar 5, 2019, 2:58:11 PM3/5/19
to AdWords API and Google Ads API Forum
Hello,

Unfortunately, It is not possible to get the descriptive name of all the accounts in a single API call. You have to iterate through all the customers to get the descriptive_name. To keep the data normalized we are holding only one resource responsible for a data field.


Regards,
Sai Teja, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_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/c7dcc262-abb6-4fca-b764-f5d43fea94ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

he...@websavvy.com.au

unread,
Mar 6, 2019, 2:06:36 PM3/6/19
to AdWords API and Google Ads API Forum
Thanks Sai for the clarity. This seems to be a significant problem that will prevent many users from completely transitioning from the Adwords API to the Google Ads API, I'm certainly going to continue using the ManagedCustomerService from the Adwords API for this functionality.
Reply all
Reply to author
Forward
0 new messages