Retrieve Customer ID via GoogleAds methods

42 views
Skip to first unread message

Andrew Hrimov

unread,
Feb 10, 2022, 8:52:05 AM2/10/22
to Google Ads API and AdWords API Forum
I'm building web application for running Google Ads from my platform. I have some questions about current API state and behavior.

As I see it - my application (backend in Django) implements web-app Oauth flow and at the end I will get refresh token - but what else I need it is cutomer_id (required parameter for any interaction with client account). How can I get it using Google methods or services and store at my platform? I found that GoogleAdwords API has such method, but as I understand it will be deprecated in upcoming release.

I wanna use client accounts manually and show just their account information, create campaigns and etc from their accounts, if it possible.

Thanks in advance, any help will be appreciated.

Google Ads API Forum Advisor

unread,
Feb 10, 2022, 3:56:00 PM2/10/22
to white....@gmail.com, adwor...@googlegroups.com
Hi Andrew,

You can follow our guide to listing accessible customers which uses https://developers.google.com/google-ads/api/reference/rpc/v10/CustomerService#listaccessiblecustomers to list all ads accounts your credentials are a user in. Then, you can use the get account hierarchy guide to find out the hierarchy underneath each accessible customer. 

Note that to access any account in Ads API, you need to log in to an account that the credentials you are using is a user in that account. If the Ads user is a user in only an MCC account, then in order to access an account lower in the hierarchy they will need to fill out the login customer Id header with the account they are a user in.

Regards,

Google Logo
Aryeh
Google Ads API Team
 


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