Reputation: 1159
Reading Google Analytics API docs is like diving into Mariana Trench... so hoping to get some help here.
I have a website that users will visit one page per visit (most of the time). I've placed google analytics script on each page (can view reports in my GA account) and now want to write a "reporting page" on which to display information about "per page usage":
page1: 100 visitors, countries, OSes, ...
page2: 125 visitors, countries, OSes, ...
I want to get this info from API.
Could some one please point me to the right pages of the docs, from the very beginning?
For I can't understand even why I should use 2-step OAuth authorization there (or shouldn't I?) - since I'm writing this report for my own site on which I have already placed google scripts thus authorizing everything.
Thank you.
Upvotes: 1
Views: 1948
Reputation: 4124
What i am thinking is that I could have a Webapplication with your pages listed. Web application itself is authenticating and querying the result on when user try to find statistics of particular page. You should follow 1. Register Service account and get authentication key file 2. Register email account viewed in along clientid email a screen in google analytic users as admin level user 3. Use ga-dev-tools.appspot.com/explorer for query building 4.Implemenation needs a) First Authenticate with the key b) Get profile id and pass it to the fetching method c) Fetch data of the query
Upvotes: 1