Show HN: I replaced Google Analytics with simple log-based analytics
(data engineer here)<p>Nice post! It's always fun reading about people being creative and challenging the analytics status quo (aka GA). Besides the joy of doing it yourself, you've accomplished a couple other things worth mentioning:<p>1. You'll never be sampled. GA samples historical data pretty heavily, and you have to pay for 360 to retain unsampled event data (at a tune of $160k+ per year).<p>2. You have full access to all generated data.<p>I'd highly recommend using Snowplow's javascript tracker (<a href="https://github.com/snowplow/snowplow-javascript-tracker" rel="nofollow">https://github.com/snowplow/snowplow-javascript-tracker</a>) in a very similar manner to what you've outlined here. You'll get a ton of extra functionality out of the box, which would add yet another level of insight. With snowplow, you get the following for free:<p>1. Sessionization, which is consistent with google analytics' definition - effectively a 30 minute window of activity.<p>2. User identification - the tracker drops a persistent cookie (just like GA), so you can see returning visitors.<p>3. Tools for splitting requests<p>4. A variety of event types, out of the box: <a href="https://github.com/snowplow/snowplow/wiki/2-Specific-event-tracking-with-the-Javascript-tracker" rel="nofollow">https://github.com/snowplow/snowplow/wiki/2-Specific-event-t...</a><p>5. Ability to respect Do Not Track<p>6. Time on page, browser width/height, etc<p>7. Ability to make your event tracking 100% first-party<p>(Disclaimer: I don't work for them, but I've seen the system work very well a number of times.)<p>I'm running a similar setup on my blog, and it costs well under $1 per month: <a href="https://bostata.com/client-side-instrumentation-for-under-one-dollar/" rel="nofollow">https://bostata.com/client-side-instrumentation-for-under-on...</a>. I'm doing the same exact thing with Cloudfront log forwarding and have several lambdas that process the files in S3. From there, I visualize traffic stats with AWS Athena (but retain a ton of flexibility, since they are all structured log files).