I am attempting to retrieve Google Analytics daily visitor counts. I'm following this blog post.
For under 30 days of consecutive data, everything works great. The problem is that the result rows get "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, because they actually represent the sum of January 1st + February 1st, and the sum of January 2nd and February 2nd, and so on. In other words: there is only one entry returned for each day of the month, 1-30, instead of returning 44 entries.
How can I adjust for this, without breaking the query into multiple calls?
Turns out, I wanted the ga:date
dimension instead of ga:day
Check out the playground; it's great for figuring out params: https://ga-dev-tools.appspot.com/explorer/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With