4 ms·
If you want to have a go rolling your own web analytics calculations, I would recommend setting up SnowPlow (https://github.com/snowplow/snowplow https://github
by alexatkeplar 14y ago
If you want to have a go rolling your own web analytics calculations, I would recommend setting up SnowPlow (https://github.com/snowplow/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 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) ;