Search code examples
google-analyticsgoogle-analytics-apimatomouniversal-analytics

Get hourly visitors statistics through Google / Piwik API


Is it possible to get hourly visitor stats per unique url from either piwik or google analytics api?


Solution

  • 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.