Authenticate Google Adwords Email with Service Account API Email

11 views
Skip to first unread message

ritesh1...@gmail.com

unread,
Feb 19, 2018, 2:51:54 AM2/19/18
to AdWords API Forum
Hi 

I am using service account API for Google Analytics and Google Adwords. 
Here Google Analytics is working perfectly as i using email (xyz..iam.gserviceaccount.comas authorized user in Google Analytics admin settings.

For Google adwords i have different account x...@gmail.com which is associated with Google Adwords API.

With my service account PHP client code i am using this
$client->setSubject(xyz..iam.gserviceaccount.com);
In the Google API console i have added x...@gmail.com  as the Service account user.

How i will make Google Adwords working with service account with above scenario?
Do i have to add xyz..iam.gserviceaccount.com  as authorized user in Google Adwords also. ( i don't have access to add so i have not tested)

since i have already added x...@gmail.com as authorized service account user in Google API console then it should work, but it is not.

Please help.

Regards
Ritesh

Vincent Racaza (AdWords API Team)

unread,
Feb 19, 2018, 3:46:41 AM2/19/18
to AdWords API Forum
Hi Ritesh,

In the AdWords API perspective, you can only authenticate in the AdWords API as service account if you have a G Suite domain. If you don't have a G Suite domain, then you need to authenticate as other types such as Installed application or Web application types. If you have a G Suite domain and you wish to authenticate as service account for the purpose of impersonation, then you need to follow this guide.

Service account authentication is quite complex in the AdWords API compared to other Google APIs so it is important that you follow the step-by-step guide from "Setting up service account access" section to "Configuring your client library" section. You also don't need to add the service account email address (e.g. xyx...@iam.gserviceaccount.com) in your AdWords account as the main purpose of this authentication type is to impersonate as any user in your AdWords account.

You may review and then follow the guide and let me know if any issue persists. If you encounter any issues/errors, then tell me what step you are currently having issues and provide any error messages or information regarding the issue via Reply privately to author option.

Thanks,
Vincent
AdWords API Team
Reply all
Reply to author
Forward
0 new messages