TL;DR I added GoatCounter to this blog to track page views.

I would like some basic blog stats

With the move of my blog to a static website hosted on the decentralised web, one thing that I lost was rich analytics on the views of each page. Wordpress gave me a lot of insights into which blog posts had historical views, which was interesting to dive into.

I could have taken the easy way and added Google Analytics, but the amount of tracking that Google does on the web already made me a bit uneasy. Which meant I was looking for a lighter weight solution. I also needed something that was completely client side, as the blog is a static website deployed to IPFS.

The research

Perfect timing, a top HackerNews post linked to an article by LWN.net on Lightweight alternatives to Google Analytics. I read through the first, as well as the follow up with More alternatives to Google Analytics.

After reading through the options, I settled on GoatCounter. I liked his goal of making a lightweight analytics platform, that was easy and did not track personal data. It is also OpenSource on GitHub.

The implementation

Adding it to my blog as easy, a single <script> tag. I also opted for adding a <noscript> pixel as well to support a wider array of browsers. I also put a little HTML comment above it to explain that it was a privacy preserving counter.
I did this by adding it to _includes\custom-head.html in my Jekyll layout.

Ironically though, it doesn’t work on my machine. As uBlock Origin extension I have installed in Edge blocks the domain ^_^;;
That is fine though, I’m not after exact numbers. Just a general idea of which pages are getting views is sufficient, so I’m happy with this implementation.

GoatCounter dashboard

Final thoughts & feedback

GoatCounter had an easy onboarding flow, and I got the whole thing set up and deployed in a couple of minutes. It is open source, doesn’t track personal data. So far I can recommend it to others if they are looking for a lightweight solution.

It is great that they have a free tier for personal non-commercial use, with 6 months of retention. I only have 100s of views a month, don’t need advanced analytics, don’t need custom domains, etc. But longer data retention might be a nice supporter feature.
Paying to support projects you use, “how much is it worth”, and especially business use, is always a hot topic. I’d be happy paying $10/year ($1/month on Patreon?) for unlimited retention for a non-commercial++ tier. But $100/year for page views for a personal blog I update infrequently seems overkill for my use case. Right now I’m comfortable with the features I get on the free tier, became a Patreon of the creator, and will recommend it to others looking for a solution.