1
votes

I'm already added as a user for someone else's Google Analytics Account and I'm granted a number of permissions. In other words, when this user (my client) visits analytics.google.com and clicks Account User Management under Admin, they see my email as in the below

screenshot

Can I create a Google Analytics API token for this user so I can perform the same tasks on behalf of this client programmatically that I'm already able to do through the Google Analytics website?

In particular, can I create this token without having to ask this user to perform any actions?

Thank you.

1

1 Answers

1
votes

You have a couple of options.

Oauth2

You could go to google developer console, create Oauth2 credentials. Then create an application that uses it, when you run your application you will be prompted to consent to the application accessing your data. If you agree the application will be able to access the data that you have access to.

Service account

You appear to have been granted full access to this account. You could then go to google developer console and create a service account, take the service account email address and add it as a new user for this google analytics account though the admin section.

Then create an application that authenticates using a service account you will have access to the data directly without any need for user intervention.