Where do you get loginCustomerId when migrating from AdWords to Google Ads migration

80 views
Skip to first unread message

Ales Sturala

unread,
Oct 26, 2020, 8:13:02 AM10/26/20
to AdWords API and Google Ads API Forum
Hello,
I wonder what the best practice is for migrating current customers from Google AdWords API to Google Ads API - specifically, where do you get the loginCustomerId?

The typical scenario is:
- let's say you have 500 Google logins within your system and their refresh tokens
- after the migration you need extra information loginCustomerId
- where do you get that? I cannot email 500 people to send me the customer Id of the MCC account that they have authenticated through OAuth2, they wouldn't have a slight idea what it is
- Is there a way in the API we can receive this?


Second question - how to get it when new Google login is authenticated through the API? Is it in the OAuth2 response? Or can we get it through the API or is it a field a user has to fill in?


Best,
 Ales

Message has been deleted

Google Ads API Forum Advisor Prod

unread,
Oct 27, 2020, 2:20:45 AM10/27/20
to al...@trueclicks.com, adwor...@googlegroups.com
Hi Ales,

For general information on migration to the Google Ads API, you can refer to this guide. As for the login-customer-id, this should be the customer ID in which the user (email address) you used to generate the OAuth2 credentials is associated to. 

To elaborate, if your access to the customer account is through a manager account (OAuth2 credentials created using a user that has access to your manager account), this header is required and must be set to the customer ID of the manager account. You will then need to specify this in your ads.properties file, where your other credentials are placed. You may refer to this client library setup guide for more information on the said properties file.

That said, referring to your scenario, there is no way via the API to extract this programmatically. You will need to identify which account you used to authenticate and you will have to specify it in your configuration as discussed in the above.

Thanks,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q274dVu:ref

Ales Sturala

unread,
Oct 27, 2020, 11:54:47 AM10/27/20
to AdWords API and Google Ads API Forum
So my concern is usability and over-complication of applications using the new API for end users.

Please correct me if I am wrong, but as of the new Google Ads API, for any 3rd party tool where users authenticate their own Google Ads logins and then select Google Ads accounts to manage by the tool, the original workflow was:

1. Have a simple button to authenticate through OAuth2 modal window with your Google login
2. Application lists out all Google Ads accounts that the login has access to so user can select which accounts to manage in the tool


In the new Google Ads API:

1. Have a simple button to authenticate through OAuth2 modal window with your Google login
2. Enter manually all customer IDs of all top MCCs this login has access to, one by one (have a good documentation explaining to a regular Google Ads user that they should only use the top MCC IDs, where they find it in the Google Ads interface and why it is needed)
3. Then list out all Google Ads accounts the login has access to


Either I am misunderstanding how to use loginCustomerId or it is quite a step back in usability for all users using tools utilizing Google Ads API.


Migration to the new API
If the above is correct, this also means that if you have 500 Google logins in your database currently for your tool, you have to ask all 500 logins to go and manually enter all top MCCs' customer IDs for their Google login. They will have to map them manually, switching between the tool and Google Ads interface and copy pasting each customer ID.


It is hard to understand why in the old AdWords API we could just list all accounts a Google Ads login has access to, just using its refresh token, while in the Google Ads API this is not possible anymore and users are required to enter data manually in order to use the API.

Google Ads API Forum Advisor Prod

unread,
Oct 28, 2020, 11:28:46 PM10/28/20
to al...@trueclicks.com, adwor...@googlegroups.com
Hi Ales,

Thank you for your feedback. Please allow me to reach out to the rest of our team so we can discuss your scenario. We'll reach back to you as soon as we are able to.

Best regards,

Ales Sturala

unread,
Oct 30, 2020, 4:44:59 AM10/30/20
to AdWords API and Google Ads API Forum
Hello,
I think that I have found the answer. It is actually possible to get the loginCustomerId through the API by using this service:


So I believe that for both scenarios:

I. Migration of current customers
  • We can write a script that will use  ListAccessibleCustomers method to look up the loginCustomerId for every existing Google Ads account
II. Adding new Google login
  • Using the same method, after OAuth2 process completes and returns a refresh token, we can list all the Google Ads accounts the refresh token gives us access to

The documentation actually very well documents those scenarios from my original post: https://developers.google.com/google-ads/api/docs/account-management/listing-accounts

My bad not reading the documentation first.


Best,
 Ales

Google Ads API Forum Advisor Prod

unread,
Oct 30, 2020, 10:33:23 AM10/30/20
to al...@trueclicks.com, adwor...@googlegroups.com
Hi Ales,

That's exactly correct, I'm glad you were able to find that documentation and find it helpful. 

For reference, the client libraries also have examples on how to use the ListAccessibleCustomers method, see the example for Java here.

Let us know if you have any other questions!

Best,
Ben, Google Ads API Team

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