Reputation: 21
I have been working on my college project for five months. I have developed a web application in Java that basically shows the my blog traffic, visitors, views etc. to my web application's users and I also have a blog with Google analytics implementation.
My problem is that I want to access my blog analytics data through Google analytics API to show my web application's users and I have tried many things to implement it but every time they ask me for authentication to access Google Analytics API.
I have also created the credentials (oauth 2.0 Client Id) to access my personal information using Analytics API but still it asks me for authentication.
So how should I directly access my blog analytics data through Google Analytics API and get the JSON response without authenticating myself?
Upvotes: 1
Views: 495
Reputation: 95499
In this particular scenario, you need to create a "service account"... this is basically a robot account that you grant access to, and then you'll make your API calls using this account (rather than your personal account or the account of the users visiting your website). In order to keep the credentials for this service account secure, though, you will need to invoke the API on your server (as opposed to authenticating in the user's browser / on the user's computer). See instructions/examples here:
Upvotes: 1