There’s Google Analytics. I discarded it, at least for now, as creating an account is a hassle.

There’s Matomo.

And I found this privacy-friendly tool called GoatCounter. You can self-host it, or you can use the free version as long as you do not abuse it, or use the paid version.

The way these web analytics tools work basically, is that you have to embed a “small” piece of Javascript in every page of your website. And any time someone visits the website, the javascript runs (in their browser) and sends information to the web analytics servers, where you can later visualize the metrics. Simple.

In this case, I am using GitHub Pages with Jekyll’s Minima theme.

The first thing to figure out is the version, which can be found here: https://pages.github.com/versions.json. I had this other link bookmarked but they removed it apparently.

Then I went to the repo for Minima and I sifted through the files of the right version (v2.5.1), and I found the file _includes/head.html which mentions the contiguous google-analytics.html file (where GA’s script is stored).

The same place (head) should be good enough for GoatCounter as well, because in GoatCounter’s page it says:

Getting started is pretty easy, just add the following JavaScript anywhere on the page …

Creating an account in https://www.goatcounter.com/ is straightforward.

To set it up I created these 2 files:

And now I can have an idea of how many people are visiting the blog.