List of Customers in Google Ads API

2,771 views
Skip to first unread message

Nenad Pantic

unread,
May 6, 2021, 12:27:21 PM5/6/21
to AdWords API and Google Ads API Forum
We are migrating to use Google Ads API, as per migrating service guide; we were previously (Google AdWords API) using getCustomers to get a list of Customers for a User.

It seems that to do the same in  Google Ads API,  we need to use listAccessibleCustomers to get a list of individual customer resources, and then make individual get calls to get each customer, and then join responses in a list.

There are two issues though:
  • get requests seems to be a no-no as per Access Level Permissible use. Above approach will lead to the quota exhausted really quickly.
  • network chatter and processing needed significantly increased - if user has 20 Customers, then 20 individual get requests will be made
Is there a better way to get a list of Customers for a User in Google Ads API?


Google Ads API Forum Advisor Prod

unread,
May 6, 2021, 9:50:54 PM5/6/21
to ne...@optily.com, adwor...@googlegroups.com
Hi Nenad,

Thank you for posting your concern.

I would like to clarify first that ListAccessibleCustomers will only return the list of all accounts that you are able to act upon/access directly given your current credentials, not the hierarchy of the MCC account. You may refer to this document to read more information about ListAccessibleCustomers.

If you want to get the hierarchy of the MCC account, then you will need to follow this document instead. You will only need to make 1 API request so there will be no problem with get operations limit.

Hope this will help. Let me know if you have further questions.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2GKWjt:ref

Nenad Pantic

unread,
May 7, 2021, 4:12:43 AM5/7/21
to AdWords API and Google Ads API Forum
Hi Ernie,

We were previously getting list of all Customers that User has access to. We were not interested in hierarchies of manager customer accounts.
If possible, I would like to keep this approach - get list of Customers that are accessible to the user, regardless of its type (manager or "normal" customer).

Current approach (java):

AdWordsSession adWordsSession = getAdWordsSession(getOfflineCredentials(refreshToken).generateCredential());
CustomerServiceInterface customerServiceInterface = new AdWordsServices().get(adWordsSession, CustomerServiceInterface.class);
Customer[] customers = customerServiceInterface.getCustomers();

This, under the hood calls: 

which is:


"Returns details of all the customers directly accessible by the user authenticating the call."

So, this would get us list of customers with all the details included. 
Google Ads api method outlined in my previous post returns us only list of resources which is a problem because of the reasons mentioned in previous post.

Sample of the return of google Adwords api getCustomers - note that it returns a flat list of all customers with all the details (attached)

sample_customers.json

Google Ads API Forum Advisor Prod

unread,
May 7, 2021, 2:40:08 PM5/7/21
to ne...@optily.com, adwor...@googlegroups.com

Hi Nenad,

Thank you for reaching out. The listAccessibleCustomers is not a get operation thus it is counted towards the get operational daily limit. The way in the code to query the child accounts is to query the customer_client resource and it contains many user information. You could also query the customer resource to fetch the customer detailed information once getting the customer id. These are not considered the get operations.

Thanks and regards,
Xiaoming, Google Ads API Team

 

Google Logo
Xiaoming
Google Ads API Team
 


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