Ad

How To Set Up Google Analytics API Access To Just One Account

I'm using the Google Analytics API for a project and I would like to know if it's possible to request access to just one project from the user account instead of all of his projects.

So right now I'm asking for access to the following scope https://www.googleapis.com/auth/analytics.readonly and this grants me access to all the projects from the user account. Is there a way to narrow this permission to just one project and the user would select which project he would give me permission to read the data?

Ad

Answer

The way Oauth works with the Google Analytics api is when a user grants you access to their google analytics account. They are granting you access to everything in their google analytics account.

For me this is a problem because i have access to customer google analytics accounts and i dont want to grant third party applications access to them. Due to this limitation i have never been able to use third party applications.

There is no way to limit it. Its an all or nothing type of thing. I have brought it up with the team in the past currently there is nothing we can do about it.

Ad
source: stackoverflow.com
Ad