[Google Ads API Python] - Retrieve all customers names under the MCC account efficiently

1,142 views
Skip to first unread message

Jesús G

unread,
May 22, 2019, 5:17:54 PM5/22/19
to AdWords API and Google Ads API Forum
Hi all,

I'm doing a python script to get some metrics.

The problem is:
I'm working with a manager account (MCC)
To work with the accounts under the MCC account we have two options:
    1. Retrieve data for every customer doing N queries, one for each customer
    2. Retrieve data with the list_accessible_customers method, but this forces me to add by hand my account to every customer under the MCC account.
So I have a performance problem, because as first step I need to retrieve all the customers names under the MCC account.

If I try to retrieve the information doing a IN operation, the API tells me that I should do one request for each customer.
Also I tried to use list_accessible_customers but is not affordable, because it's needed manual work (If I understood well the documentation).

Any suggestion about how to retrieve all customers names under the MCC account with only one operation using a search with the GoogleAdsService.search method?

Lot of thanks.

Google Ads API Forum Advisor Prod

unread,
May 23, 2019, 2:57:13 AM5/23/19
to jguti...@paratytech.com, adwor...@googlegroups.com
Hi Jesús,

Thank you for reaching out.

Based from your post, I can see that you wish to retrieve all customer names under a MCC account. Unfortunately, there is not direct way to implement this in the Google Ads API. The best option I can think of is to use the CustomerService.ListAccessibleCustomers() method and retrieve the list of clientCustomerIds under that MCC account. After this, you might have to iterate through the list and use the CustomerService.getCustomers() to get the descriptive_name field for the customer account name.

Let me know if you have further clarifications.

Regards,
Dannison
Google Ads API Team

ref:_00D1U1174p._5001UAqNRN:ref

Google Ads API Forum Advisor Prod

unread,
May 23, 2019, 2:57:37 AM5/23/19
to adwor...@googlegroups.com
 

ref:_00D1U1174p._5001UAqNRN:ref

Life Lai

unread,
Nov 8, 2019, 2:07:24 AM11/8/19
to AdWords API and Google Ads API Forum
Hi,Dannison
    I have the same problem.
    I try to find the CustomerService.getCustomers() method, but in the documentation I only find CustomerService.getCustomer method, which get detail this current MCC accout.
    at the moment can't solve my problem.

Regards,
Life

在 2019年5月23日星期四 UTC+8下午2:57:13,adsapiforumadvisor写道:

Google Ads API Forum Advisor Prod

unread,
Nov 14, 2019, 12:07:13 PM11/14/19
to ldm...@163.com, adwor...@googlegroups.com
Hello Life,

The same functionality as of the CustomerService.getCustomers() in AdWordsAPI is available via customerClient resource in Google Ads API Beta. You could use the below query to get all the accounts under an MCC. Please let me know if you have any further questions.

Query: 
"SELECT customer_client.client_customer, customer_client.currency_code, customer_client.descriptive_name, customer_client.hidden, customer_client.id, customer_client.level, customer_client.manager, customer_client.resource_name, customer_client.test_account, customer_client.time_zone  FROM customer_client"

Regards,
Sai Teja, Google Ads API Team

ref:_00D1U1174p._5001UAqNRN:ref
Message has been deleted

CDG

unread,
Apr 3, 2020, 11:45:00 PM4/3/20
to AdWords API and Google Ads API Forum
If I want to get all accounts
Only usage GoogleAdsService.search(query) ?

在2019年11月15日星期五UTC+8上午1:07:13,adsapiforumadvisor寫道:
Hello Life,您

可以通過 Google Ads API Beta中的customerClient資源使用與AdWordsAPI中的CustomerService.getCustomers()相同的功能您可以使用以下查詢獲取“我的客戶中心”下的所有帳戶。如果您還有其他問題,請告訴我。

查詢: 
“ SELECT customer_client.client_ 客戶,customer_client.currency_code,customer_client.descriptive_ 名稱,customer_client.hidden,  自定義er_client.id,customer_client.level,customer_client.manager,customer_client.resource_name,customer_client.test_account,customer_client.time_zone FROM customer_client”

問候,
Sai Teja,Google Ads API小組

參考:_00D1U1174p._5001UAqNRN:參考

Google Ads API Forum Advisor Prod

unread,
Apr 6, 2020, 2:54:56 PM4/6/20
to cddd...@gmail.com, adwor...@googlegroups.com
Hi Life,

Thank you for reaching out to us. You can utilize this example to get the list of customers under your manager account by taking the query Sai Teja provided for you and replacing the query field in the example. Let me know if you have further questions.

Thank you,
Bryan, Google Ads API Team

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