Nertan Lucian
Nertan Lucian

Reputation: 342

User does not have sufficient permissions for this profile. - Google Analytics API v4

I've created a few Google Analytics V4 only properties a while ago.

Big mistake.

I'm using Google Spreadsheets to track the progress and such, and had to waste time migrating the API for it using OAuth2 and the Google Analytics Data API (GA4)

All went fine. Until a few weeks ago when it stopped working. I see there's a new version, Google Analytics Reporting API v4

I've procrastinated, so I'm doing the migration now, but hit a brick wall:

"User does not have sufficient permissions for this profile."

I don't understand why I get this issue. Remade the credential in the developer console, redone the Oauth2 process, recreated the tokens, checked everything still this issue.

So I decided trying the "Try this API", I get into the same issue

enter image description here enter image description here

Which is weird, I'm logging in using the analytics admin account. Also this error is weird:

"This error may be due to using an insufficient credential type. Try using OAuth 2.0.",

since I'm basically logging in using the provided pop-up

enter image description here

The view id I took from here:

enter image description here

I've tried with any ID I could find (yeah, even MEASUREMENT ID and STREAM ID) and multiple sites (views)

What am I missing?

Upvotes: 0

Views: 3548

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117291

your error

"User does not have sufficient permissions for this profile."

Basically means that the user you are authenticating with does not have permission to access the view id you are using. Authorize your code with user that has access to it. I have a video on this User doesn't have any google analytics accounts easy solution

confusion

I am however a little confused as to what you are doing. Your code says that you are using the Google Analytics reporting api, your using a view id which implies that this is a universal analytics account.

Yet you are trying to use the Google analytics data api which is intended for use with Google Analytics GA4 accounts. Google Analytics Data API (GA4) and won't work with your universal analytics account with a view id, it only works with the new Google Analytics GA4 accounts.

Upvotes: 2

Related Questions