How can I get user's details after he loggedin in google ads account.

18 views
Skip to first unread message

abhishe...@emartsolutions.in

unread,
Oct 19, 2017, 2:00:27 AM10/19/17
to AdWords API Forum
Dear Team,

I am using googleads-php-lib to integrate my application with google ads. I wan to allow user's to add their google ad account in my application So I need their details like name,emailid or account id after they log in in the google ads account.

Pls help me how can i get these details.

Thanks in advance.

Vincent Racaza (AdWords API Team)

unread,
Oct 19, 2017, 2:33:46 AM10/19/17
to AdWords API Forum
Hi Abhishek,

Currently, it is not possible with the AdWords API to get the details of the user who logged in. Kindly follow our blog for any future updates like new releases.

Thanks,
Vincent
AdWords API Team

Zweitze

unread,
Oct 19, 2017, 3:35:31 AM10/19/17
to AdWords API Forum
You need the gmail API for that, but you can integrate the authentication:
Basically, when you ask for authentication you not only ask for AdWords access but also mail access. The user will see a consent form stating that your software will access their AdWords accounts(s) and also their mail. Once authenticated you can use the refreshtoken/accesstoken for both AdWords API and gmail API.

Note I don't use PHP myself so I don't know how this works out in PHP. But you should get the idea.

There is a downside to this approach: If you store refreshtokens (for instance, you use them for batch processing in the night), do realize that they become invalid when the user changes his password. This happens to all refreshtokens having access to gmail API. (In other words, a refreshtoken with only access to AdWords API will survive a password change of the authenticated user. But a refreshtoken that also has access to gmail API will not survive a password change.) Again, this is only relevant if you store refreshtokens, for instance for batch processing.

Hope this helps.
Reply all
Reply to author
Forward
0 new messages