Analytics Google API Error 403: "User does not have any Google Analytics Account"

user989501 picture user989501 · Oct 11, 2012 · Viewed 80.3k times · Source

I'm creating an script, based on Google Analytics step-by-step guide from this page:

https://developers.google.com/analytics/resources/tutorials/hello-analytics-api

Authorization is done without problems, until it tries to access data. The return code is 403, and error message is:

User does not have any Google Analytics account

This message has no sense: my account has google analytics data, tracking multiple websites, and I can access it from web browser without problem. I've allowed Analytics API through Google APIs console, and API access is giving me right data.

Answer

S M picture S M · Oct 31, 2012

I had this problem too. I fixed it by adding the email address for my service account to the Google Analytics profile I wanted it to access.

I got the email address (something like [email protected]) for the service account by looking under the "API Access" tab in the Google APIs console.

Then, I followed Google's instructions for adding an email address to an Analytics profile. Now everything's working as expected.

Good luck!