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
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:"