Search code examples
google-analytics-api

Can google analytic API provide all info of all pages of a website?


I am new to Google Analytics. I would like to get all information (Unique and Total Visitors, Redirecting URL etc) of a Profile, which has url like www.someurl.com/profile/unique_profile_id

So I can easily have unique url for each profile, but as I am new to this. I don't know where to start.

API docs is good but confused where to start. If some can suggest small source of getting started with what i mentioned it will be very helpful. Thanks in advance.

I come up with this query, but still I am not understanding ga:ids. This ga:id is for my home page www.mydomain.com

https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A90283827&start-date=30daysAgo&end-date=yesterday&metrics=ga%3Apageviews%2Cga%3AuniquePageviews

Let's suppose my site have 1000 user and their profile has url as I mentioned above. So what will be ids for that each profile to query.


Solution

  • I think you are miss understanding how the Google Analytics API works. The api returns raw data back from Google Analytics in the form of Json. It will be up to you to format that data.

    What I want is that how can I access data of each page that is currently available in my site.

    I sugest you look at ga:pagepath by adding this dimension you will be able to request data by the page. for example pagepath, sessions will give you the number of sessions by the page path. You may want to try testing using the query explorer so that you can get back only the data you need.