Linking individual customer's AdWords account with corresponding GMB account

25 views
Skip to first unread message

kru...@yclub.io

unread,
May 22, 2017, 2:54:50 AM5/22/17
to AdWords API Forum
Hello,

I was reading up on the Location Extension of AdWords API and realized that I would need a refresh token associated with the account that has MGB set up.

I am going to have customers who have already registered their business via GMB and I want to provide AdWords automation via API.

For now, I think I will be required to tinker around with the client library, getRefreshToken.java and use some kind of headless-web-driver such as Selenium to:
1. navigate to the url provided by the example code
2. sign-in with customer credential (for which I will need their id//password)
3. copy the code provided upon sign-in
4. feed it back to the same route the example code uses

I would rather not ask my customers for their credentials if I could do this in pure Java way.

What do you guys think? and how differently would you fellow devs have tackled this problem?

Ivan Bautista

unread,
May 22, 2017, 4:54:26 AM5/22/17
to AdWords API Forum
Hi Kruger,

As per sample code, if the gmbEmailAddress specified is the same email used to generate the existing refresh token and OAuth2 credentials for your AdWords Account, then you may use the same existing credentials found in your ads.properties file to set the access token in the oAuthInfo field via oAuth2Credential.getAccessToken(). 

Otherwise, if you are using different Google accounts for GMB and AdWords, then you must generate a separate credential to set the access token in the oAuthInfo field as discussed in here.

Regards,
Ivan 
AdWords API Team
Reply all
Reply to author
Forward
0 new messages