“Not sufficient permissions” google analytics API service account

不想你离开。 提交于 2019-12-02 17:58:29
jarace87

I was getting exactly the same error and this solved it for me:

I was using the account ID instead of the View ID. Switching to the View ID fixed it - it’s always the “View ID” and not the account or property ID (which looks like “UA-xxx”). The View ID is for a specific web property and can be found in the Admin->View (3rd column)->View Settings. It’s an integer with no dashes.

https://stackoverflow.com/a/15789266/1391229

Had the same issue today, the profileId is hard to find, you can have it in every Url in analytics let's say https://www.google.com/analytics/web/#management/Settings/aXXXXXXwYYYYYYYpZZZZZZZ/ it's the ZZZZZZZ part

Same issue. Solved it by using the VIEW id instead of the account Id (UA-XXXXX-1).

Analytics Console > Admin -> View (Profile) -> View Settings -> View ID

AND

Make sure that you add the service account to your list of users in the Google Analytics Console. Simply setting it up in the Credentials, API and Permissions section of the developer console will still not grant it access to your analytics.

Analytics Console > Admin -> Account -> User Management -> "Add permissions for:"

Got the same error but after a while I recognized that i was using this script with my google chrome (my own email adress) but the Analytics API is running on the companies email. So the solution could be to edit the settings of your google chrome. Just disconnect from the gmail account in your google chrome (settings) and test it again.

Use View ID Not account ID, on Admin tab, 'View Settings' 'View ID'.

Leumas Naypoka

Helped me a lot after 2 weeks of trying to find solution:

Analytics Console -> Admin -> View (Profile) -> View Settings -> View ID

On a different application I was getting "Not sufficient permissions" and found my .htaccess file had some file restrictions that caused the problem.

I had the same problem using .net library, after some tinkering, i found the solution:

Go to your google analytics management site & add the service account as a user & grant that account the necessary rights

might be you are using other Client ID: Client secret: to get another profile id details

Had the problem.. it turns out the Account ID is hidden in the URL of your analytics account!

https://developers.google.com/analytics/devguides/reporting/core/v3/#user_reports

The URL typically looks like so:

https://www.google.com/analytics/web/?hl=en#management/Settings/a51343283w84330433p87396224/%3Fm.page%3DAccountSettings/

The ID we are looking for follows the letter p.

In the example above, the ID that will work is: 87396224

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!