Google Analytics API "ga: day" and more than 1 month of data returns aggregate instead of absolute values

I am trying to get the daily number of visitors to Google Analytics. I am following this blog post .

For 30 days of serial data, everything works fine. The problem is that the result lines are "grouped together." Consider this query:

{ ids: 'ga:44339606', 'start-date': '2013-01-01', 'end-date': '2013-02-14', dimensions: 'ga:day', metrics: 'ga:visits', segment: 'gaid::-1' } 

The values ​​returned for days 01-14 are incorrect, since they actually represent the sum of January 1 + February 1 and the amount of January 2 and February 2 and so on. In other words: for each day of the month, only one record is returned, 1-30 instead of 44 records.

How can I configure this without interrupting the request for multiple calls?

+4
source share
1 answer

Turns out I need the size ga:date instead of ga:day Check the playgrounds; this is great for defining parameters: https://ga-dev-tools.appspot.com/explorer/

+8
source

All Articles