Exploring Fathom Analytics

In terms of web analytics, Google Analytics dominates. I’ve tried some of the open source alternatives (see below from wiki) however I haven’t been very impressed. Most of them are difficult to use. In fact, only two of them work as easy as Google Analytics with a simple copy/paste JavaScript embed.

WordPress and the internet at large would greatly benefit if there were more modern web analytics alternatives. Something where you could own your data, not Google. And now there is. Meet Fathom, a new open source alternative to Google Analytics.

It’s early days for Fathom.

The warning on Github pretty much sums that up, “Do not run Fathom in production yet unless you like spending time on it.” Well call me adventurous, but I’ve compiled and have been running Fathom on https://anchor.host for the last few weeks. It’s been a fun little experiment. I really hope Fathom gains the momentum it needs to become a serious alternative.

An open sourced web analytics combined with WordPress would be awesome.

One of the greatest things about WordPress is you own your data. Don’t like your web host? Then make a backup of your website and go somewhere else that supports WordPress. Ownership of data is not just a nice to have, it’s becoming a necessity. True ownership is only possible if the underlying platform is open and accessible for everyone. Combining an open platform like WordPress with an open web analytics platform would be amazing.

Geeking out with the self-hosted version.

So the rest of this is going to be a rough overview of how I’m running a self hosted version of Fathom based on the direct source code. As mentioned early, this is not ready for production so only proceed if you expect everything will break.

  • Setup a $5/month DigitalOcean droplet (Ubuntu 16.04)
  • Configure NGINX with Let’s Encrypt
  • Install MariaDB and configure
  • SSH and run git clone https://github.com/usefathom/fathom.git
  • Copy .env.example to .env and configure with database. For scripting purpose I found .env needs to be in the same directory as the current directory your launching from. Easiest is to just move it to the home directory.
  • Compile into binary & prepare assets. This takes some prep work as a bunch of NPM and GO packages are required. However once a Fathom beta is release this will be can be skipped as you’ll just download fathom and run it.
  • Fathom is a cross-platform executable program. Running fathom server will start it’s bundled web server, however that only supports http. In order to make it https accessible I’ve configured NGINX in front of Fathom using configurations mentioned here.
  • Again, I’m not a Go developer so I don’t know the best way to handle compiling, however for ease of scripting I ended up symlinking the fathom directory to the home directory like this ln -s ~/go/src/github.com/usefathom/fathom/ fathom. That let’s me reference the server like this ~/fathom/fathom server.

For ongoing management of the Fathom server use a script.

Running scripts/update.sh will pull in the latest source code, recompile, shutdown the current background Fathom process and start up a new Fathom server in the background while logging to a file.

cd ~/fathom/
git pull
make all
pkill -f "fathom s"
nohup ~/fathom/fathom s > ~/logs/fathom.log 2>&1 &