“Not sufficient permissions” google analytics API service account

后端 未结 11 1616
执念已碎
执念已碎 2020-12-24 12:16

I\'m trying to fetch data with the Google Analytics API through service accounts.

I have been searching on stackoverflow how to do this and been using the exact sam

相关标签:
11条回答
  • 2020-12-24 12:27

    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

    0 讨论(0)
  • 2020-12-24 12:27

    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:"
    
    0 讨论(0)
  • 2020-12-24 12:33

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

    0 讨论(0)
  • 2020-12-24 12:33

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

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

    0 讨论(0)
  • 2020-12-24 12:38

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

    0 讨论(0)
  • 2020-12-24 12:39

    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

    0 讨论(0)
提交回复
热议问题