Show HN: I replaced Google Analytics with simple log-based analytics

Show HN: I replaced Google Analytics with simple log-based analytics

Finally I added a small code snippet at the bottom of my page template (Cloudfront domain replaced to avoid bots hitting it from here):

If JavaScript is enabled, we create an image and point its to the Cloudfront pixel file, with the URL and referrer encoded in the query string (my log converter will later decode the and parameters and output a log line in combined log format). It reads Cloudfront log input files, decompresses them, decodes the and parameters in the query string, and writes the output in combined log format. It also handles files (like Cloudfront log files) seamlessly with a simple tweak:

Once the script has read a Cloudfront log line and ensured it’s a request, it decodes the query string and outputs in combined log format:

The output is a single log file with all the log lines in it.

Source: benhoyt.com