Counting goats

Finding out if someone visits my website.

Filed under: web

I would describe myself as a privacy-conscious person. Therefore it wasn't an easy choice for me if I should implement some kind of analytics on my website. But in the end, my curiosity won and I decided to add some kind of tracking/analytics to my site. The solution had to be as privacy-aware as possible while still providing useful data. So I didn't even consider tools like Google Analytics which have a very bad reputation regarding privacy.

After some research I found three possible candidates Fathom Analytics, GoAccess, and GoatCounter.

I rejected Fathom Analytics early on as it is only available via a paid subscription which would not be a viable option for my homepage. There is also a lite version available that can be hosted but it requires cookies to work which also was a no-go for me.

GoAccess takes a different approach to aggregate visitor information than most solutions. Instead of a client-side script, it analyzes the server access logs for the page in real-time. The results can either be viewed in the terminal or the browser. And I have to say that the web view is pretty sexy but see for yourself in this live demo or the screenshot below. GoAccess provides many functionalities and presents the data very nicely. But server access logs have to be enabled and GoAccess has to have access to them. Because of its complexity and because it didn't quite feel like the right tool for the job I rejected GoAccess after playing around with it for some time.

Screenshot of the GoAccess web interface

This left only GoatCounter as a possible analytics tool. It is built and operated by Martin Tournoij aka arp242 and the source code is available on GitHub. On the landing page, it advertises features like privacy-awareness, small size, accessibility, and data ownership. All of those features lead me to chose this solution. Besides the usage is free for non-commercial projects which also made it attractive for me. The user interface is pretty simple but it provides clear information about all the data that I care about. A screenshot can be seen below. Getting the whole thing to work took surprisingly little time. I only had to create an account and insert a small script tag at the bottom of my page and suddenly the page visits were visible in the backend.

Screenshot of the GoatCounter web interface

As you can see there are plenty of privacy-focused web analytics tools out there. It is just pretty difficult to choose one of them. Time will show if I made the right decision by choosing GoatCounter but I have a very good feeling that it was the right choice.