JS console errors
chrxr opened this issue · 5 comments
Hi @tomdyson,
I've got to the point where everything is installed, but I'm afraid I'm getting a whole load of JS console errors. A screenshot of the console is attached. I'm getting these errors both locally and on production.
It's mostly 403s... Something to do with insufficient permissions? Pretty sure I have my service account setup correctly and added to my GA account
It looks like permission issues on your account. Are you sure you've got the correct site ID? If you view source for that page, do you see a value for 'access_token'?
If so, try requesting
swapping out [your-site-id] and [generated-token].
Yes, there is a value in access_token.
{"error":{"errors":[{"domain":"usageLimits","reason":"accessNotConfigured","message":"Access Not Configured. The API (Google Analytics API) is not enabled for your project. Please use the Google Developers Console to update your configuration.","extendedHelp":"https://console.developers.google.com"}],"code":403,"message":"Access Not Configured. The API (Google Analytics API) is not enabled for your project. Please use the Google Developers Console to update your configuration."}}
So, the API wasn't enabled for the project/service account created. I've enabled the API and now everything is great!
Once you create the project & service account, you need to go to the interface below to activate the API for the particular project:
https://console.developers.google.com/apis/api/analytics/overview
That's not mentioned in the setup pages you've linked to, so probably worth including in the readme. But anyway, all is well now for me! Thanks!
I ran into this same problem. Because I created a new Project as part of the steps to generate a Service Account, that project didn't have the Analytics API enabled (even though I had enabled it in my previous Projects, which is why I was so confused about it being disabled).
I second the suggestion that this advice should be added to the setup instructions.
One note that caught me up on this is to not use the number starting with UA-
but rather the "View ID" under property > account > view > settings in Analytics.