0
votes

I am working on embedding of our google analytics dashboard in our web portal using its API, after walking through this example, Embed API - Getting Started

I am facing a problem; that when I logged in to google analytics account and run this example, it is fetching the results, but when there is no logged in session, it returns

Object { errors=1, code=403, message="User does not have any Google Analytics account."}

retrieved from browsers developer tools... I have added the service account email address to Analytics Admin Console as well. please suggest the solution

1
not 100% the same @EikePierstorff hes got an error message which is diffrent - DaImTo
Maybe I misunderstood the question - I assumed the OP wanted data from the embed API without logging in with his own credentials (in which case the other answer seems to apply, even if the question is different). - Eike Pierstorff

1 Answers

0
votes

You need to have a session logged in with access to the account.

Check the Google Account you are logging in with it needs to be one that has access to the Google Analytics account that you want to check. The Google account you are authenticating with currently doesn't have access to any Google Analytics Accounts.

Service account wont work with embedded API you need to use Oauth2.