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
Got the same error but after a while I recognized that i was using this script with my google chrome (my own email adress) but the Analytics API is running on the companies email. So the solution could be to edit the settings of your google chrome. Just disconnect from the gmail account in your google chrome (settings) and test it again.
I was getting exactly the same error and this solved it for me:
I was using the account ID instead of the View ID. Switching to the View ID fixed it - it’s always the “View ID” and not the account or property ID (which looks like “UA-xxx”). The View ID is for a specific web property and can be found in the Admin->View (3rd column)->View Settings. It’s an integer with no dashes.
https://stackoverflow.com/a/15789266/1391229
might be you are using other Client ID: Client secret: to get another profile id details
Please create shared segment...It will work
http://www.periscopix.co.uk/blog/google-analytics-new-feature-shared-segments/
I had the same problem using .net library, after some tinkering, i found the solution:
Go to your google analytics management site & add the service account as a user & grant that account the necessary rights