Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: API returned: User does not have sufficient permissions for this profile. #426

Open
sshemtov opened this issue Jun 7, 2023 · 5 comments
Assignees

Comments

@sshemtov
Copy link

sshemtov commented Jun 7, 2023

Hello,

Running into an issue where I'm able to query 1 GA4 property that outputs in my ga_account_list() but 2 of the other properties in ga_account_list() get the error:

Error: API returned: User does not have sufficient permissions for this profile.

I'm using the same gmail user that created/admin all 3 GA4 properties and which created the Google Console credentials. Google Analytics Data API and Admin API are both enabled. Seems odd that 1 out of the 3 properties works while 2 do not work.

Any ideas?

Thanks

@cansavvy
Copy link

cansavvy commented Oct 31, 2023

I'm also receiving this error and have also enabled the Google Analytics Data API.

Error: http_403 User does not have sufficient permissions for this profile.

Here's the steps I've been following:

ga_auth()
account_df <- ga_accounts()
account_df$id

## View account_list and pick the viewId you want to extract data from. 
ga_id <- account_df$id[2]

## simple query to test connection, get 10 rows
google_analytics(ga_id,
                 date_range = c("2021-01-01", lubridate::today()),
                 metrics = "sessions",
                 dimensions = "date",
                 max = 10)

@gronerik
Copy link
Collaborator

gronerik commented Sep 5, 2024

Hi @sshemtov and @cansavvy! Sorry for the delay on getting a response to you.

Have you checked that there's a proper ID available for the account_df$id[2] variable for sure? Does this happen every time or just occasionally?

@cansavvy
Copy link

cansavvy commented Sep 5, 2024

The ID account I had worked when I made my own R package.

I haven't tried using googleAnalyticsR in a bit but can try again.

@cansavvy
Copy link

cansavvy commented Sep 5, 2024

Okay just retried my code from above and still getting the same error.

@gronerik
Copy link
Collaborator

Thanks @cansavvy for testing this again. This is strange behavior and can't repro this with my GA4 properties. Could you provide the content of your account_df Data Frame yet for me to see more details? Please remove or mask any sensitive information of course, I'm just interested in the possible differences between the working and not working example properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants