getCustomers in Google Ads API with same behavior as Adwords API

106 views
Skip to first unread message

Atman Darji

unread,
Sep 3, 2020, 7:10:12 AM9/3/20
to AdWords API and Google Ads API Forum
Hello,

In Google AdWords API, we have a method getCustomers in CustomerService. It gives us a list of all the customers which are directly accessible by the authenticated user. In that list, we can get CustomerID, along with descriptiveNamecurrencyCode, etc for each customers.

I was exploring Google Ads API. In the Google Ads API, we have CustomerService, but it doesn't have method getCustomers, instead we have ListAccessibleCustomers, which returns ListAccessibleCustomersResponse. That is just list of resource name of customers directly accessible by the authenticated user. The resource name just contains just CustomerID and nothing else. To get all other fields of all the customers like descriptiveNamecurrencyCode, etc. we have to make a function call to GetCustomer(GetCustomerRequest), which returns only one customer's all information. Hence we end up making API calls for each customer to get all the required fields.

If there are N customers accessible by the authenticated user, we have to make only 1 API call to AdWords to get all the fields through getCustomers, but in Google Ads API we have to make N+1 API calls! One for getting all the resource names through ListAccessibleCustomers and N API calls to GetCustomer to get all the required fields of a customer.

Is there a way to make it more efficient? Can we have the same behavior as getCustomers in Google Ads API?

Thank you in advance!

Sincerely,
Atman

Atman Darji

unread,
Sep 3, 2020, 7:11:47 AM9/3/20
to AdWords API and Google Ads API Forum
Hello all,

Documentation to CustomerService in Google Ads API: https://developers.google.com/google-ads/api/reference/rpc/v5/CustomerService

Best,
Atman

Google Ads API Forum Advisor Prod

unread,
Sep 3, 2020, 3:03:41 PM9/3/20
to atman...@clarisights.com, adwor...@googlegroups.com

Hi Atman,

Thank you for reaching out. Please try to query the customer_client resource in the Google Ads API to fetch the direct and indirect client customers in a customer's hierarchy.

Thanks and regards,
Xiaoming, Google Ads API Team





Google Logo
Xiaoming
Google Ads API Team
 


ref:_00D1U1174p._5004Q23wtwN:ref

Atman Darji

unread,
Sep 4, 2020, 2:46:24 AM9/4/20
to AdWords API and Google Ads API Forum
Hello Xiaoming,

Thanks for your prompt response! One more query. For making the query to the customer_client, I need to have a Manager Customer's ID, right? And in response I will get all the clients which are under the given Manager Customer, right?

Atman

Google Ads API Forum Advisor Prod

unread,
Sep 4, 2020, 10:25:36 AM9/4/20
to atman...@clarisights.com, adwor...@googlegroups.com

Hi Atman,

Thank you for reaching out. Yes, you are right. If you query on a manager account, you would get all the client customer accounts under this manager account hierarchy.



Thanks and regards,
Xiaoming, Google Ads API Team




Reply all
Reply to author
Forward
0 new messages