Reputation: 32
I already have a google analytics account. so when I try to run HelloAnalytics.php following Hello Analytics API: PHP quickstart for service accounts
It's response:
{"error":{"errors":[{"domain":"global","reason":"insufficientPermissions","message":"User does not have any Google Analytics account."}]
Upvotes: 0
Views: 665
Reputation: 116948
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.
Upvotes: 1