Is it possible to get hourly visitor stats per unique url from either piwik or google analytics api?
2 Answers
Google Analytics has the hour, hour of the day (i.e. date + time) and index hour (counted from the beginning of the selected timeframe). You'll find this when you look in the "secondary dimension" dropdown in the "time" section (or in the custom reports) and you can query that via the API (ga:hour, ga:dateHour and ga:nthHour).
I'm not an expert with Piwik but could not find anything like in in their demo. Of course Piwik being open source you could possibly write a plugin that displays the hour. Last time I looked the database table had a timestamp.

- 31,996
- 4
- 43
- 62
-
1Docs for the core reporting API are here: https://developers.google.com/analytics/devguides/reporting/core/v3/ – Eike Pierstorff May 23 '14 at 12:13
-
do you know whether it is possible to request metrics for a time range based on a utc timestamp? – Manuel May 26 '14 at 09:21
You can get hourly local time/website time stats per unique URL by using Piwik segmentation API ( http://developer.piwik.org/api-reference/segmentation).
In order to do it, you query the VisitTime.getVisitInformationPerLocalTime (or VisitTime.getVisitInformationPerServerTime) and add a segment parameter for given URL:
&segment=pageUrl==http%3A%2F%2Fforum.piwik.org%2Fregister.php
Example call:
http://demo.piwik.org/index.php?module=API&method=VisitTime.getVisitInformationPerLocalTime&format=XML&idSite=7&period=day&date=yesterday&expanded=1&token_auth=anonymous&segment=pageUrl==http%3A%2F%2Fforum.piwik.org%2Fregister.php
You can find more about Piwik API at: http://developer.piwik.org/api-reference/reporting-api
-
Thx Maciej, I run over piwik api previous to posting this question. As far as I understand it only supports day, week, month and year are available as period. I need at least hourly. Even better for me would be to give a utc timestamp range. – Manuel May 26 '14 at 09:17