tomdyson / wagalytics

A Google Analytics dashboard in your Wagtail admin
MIT License
217 stars 42 forks source link

Invalid Credentials #36

Open WrapTheCode opened 5 years ago

WrapTheCode commented 5 years ago

Hi

I have a problem. My settings:

GA_KEY_FILEPATH =  os.path.join(BASE_DIR, 'analytics/analyticsfile.json')
GA_VIEW_ID = 'ga:000000000' - take from view id
code: 401
errors: [{…}]
message: "Invalid Credentials"

What can be wrong?

KalobTaulien commented 4 years ago

Hi @WrapTheCode

I ran into this as well, the Invalid Credentials error (User does not have the right credentials, or something along those lines)

To solve this I had to open my Google Analytics > Admin > User Management > Add User And then add the Google IAM email address (you can find it in your analyticsfile.json file, or in your Google Cloud Console). It'll look something like this: your-user@your-user.iam.gserviceaccount.com

The screen will look like this in your Google Analytics:

image