0
votes

I already have a google analytics account. so when I try to run HelloAnalytics.php following Hello Analytics API: PHP quickstart for service accounts

enter image description here

It's response:

{"error":{"errors":[{"domain":"global","reason":"insufficientPermissions","message":"User does not have any Google Analytics account."}]

enter image description here

1

1 Answers

1
votes

You are attempting to authenticate to Google Analytics using a Service account. Service accounts by default do not have any google analytics accounts.

Add service account to Google Analytics account The newly created service account will have an email address, [email protected]; Use this email address to add a user to the Google analytics account you want to access via the API. For this tutorial only Read & Analyze permissions are needed.