News for hackers. Stuff that matters.
Re:Beginners Guide to Maths and Stats behind Web Analytics by alexatkeplar on Friday December 07, 2012 @03:06AM (#4886009)
If you want to have a go rolling your own web analytics calculations, I would recommend setting up SnowPlow (https://github.com/snowplow/snowplow) and then following through the SnowPlow Web Analyst's Cookbook (start with the simple recipes here: http://snowplowanalytics.com/analytics/basic-recipes.html).

Here's a simple example for unique visitors by month:

    SELECT
    YEAR(dt),
    MONTH(dt),
    COUNT(DISTINCT(user_id))
    FROM events
    GROUP BY YEAR(dt), MONTH(dt) ;

There are no comments on this comment yet.