I've used Google Analytics mainly for two reasons: first, I like to look at aggregate statistical data, and second, I don't see the evil in it. The user can block this external service in uncountable ways, for example, by simply rejecting the corresponding cookie, or by installing a script- or adblocker. Instead of creating a monstrous legal construct such as the GDPR, one should rather educate users to take care of themselves again. But the data protection industry only exists since these things are massively blown out of proportion, and of course they serve their own interests. They like to see the users as drooling rugrats, and they like to keep them like that. Well, that's the general trend of all western societies.
Anyway, since I recently integrated a black list into my local DNS resolver, it's actually not that simple anymore to access the Google analytics domain. 😄 Furthermore, I'm interested how many of my readers actually block Google Analytics. And most importantly, I thought it would be a good idea to take the opportunity to get rid of this proprietary garbage. 😊
I thus searched for local web analyzers and came across several, but took an immediate liking in goaccess. It's easily installed and even easier to use:
# echo "deb http://deb.goaccess.io/ $(lsb_release -cs) main" | tee -a etc/apt/sources.list.d/goaccess.list # wget -O - https://deb.goaccess.io/gnugpg.key | apt-key add - $ sudo apt update $ sudo wajig install goaccess
Goaccess comes preconfigured with the log formats of the most popular web servers, but for Hiawatha, our web server of choice, manual configuration was required. Fortunately, I found all relevant information in the Hiawatha forum:
time-format %T %z date-format %a %d %b %Y log-format %h|%d %t|%s|%b||%r|%v|%u|%^|%^|%^|%R|%^|%^
Since the reports of goaccess are directly generated from the access logs of the web server, I anonymized the IP by activating the
anonymizeIP = yes
option in /etc/hiawatha/hiawatha.conf.
Finally, I configured goaccess to automatically generate html reports. Logrotate takes care of periodically deleting the logs (which don't contain personal information anyway). The reports, by the way, show that at least 75% of all visitors of this site block Google Analytics. Excellent! Also, I'm happy to see that I have four times as many readers than I thought. 😉
The next task was a local installation of the Google fonts I'm using. That was very quickly done by cloning the bash script 'best-served-local' of Ronald van Engelen and running it:
git clone https://github.com/ronalde/best-served-local cd best-served-local ./best-served-local -i ../static/fonts "Kreon:300,400,700" > ~/temp/fonts/kreon.css ./best-served-local -i ../static/fonts "Fira Mono:400,700" > ~/temp/fonts/fira.css
The css snippets thus created have to be included in the main css file of the blog's theme, which in my case is a modified bootstrap. The fonts themselves go into ../output/assets/static/fonts (that has to be consistent with the option for the command line parameter -i above).
Next, I wanted to get rid of the dependency on an external resource for MathJax. I struggled first with a local installation of KaTeX, but couldn't get it to work. MathJax instead was very easy. I simply installed libjs-mathjax and fonts-mathjax on pdes-net.org, and copied it to a location accessible to the webserver
and back to my local blog installation
scp -r cobra@netcup:/var/www/hiawatha/cobra/output/assets/static/mathjax/ home/cobra/ownCloud/MyStuff/Documents/pdes-net.org/output/assets/static/
Finally, the Nikola configuration file had to be updated correspondingly:
Finally, the search box on this site already works on the client side by virtue of tipuesearch. So, I was done!
Ah, not entirely: I still had to update my contact page. After doing that, I also moved the link to the bottom of the page as its customary on most sites.