On Migrating from Google Analytics

In this post we'll explore what happened when I migrated away from Google Analytics (GA) to a self-hosted solution. The tool that I migrated to is an open-source platform called Countly. It offers a subset of features from what GA offers.

When creating content for this website my typical flow is to first publish a post, then submit it to sites like Hacker News and Reddit, and keep an eye on analytics for a couple days to see how it does. This helps me figure out what my audience find interesting.

There are a few questions that I need an analytics solution to be able to answer for me:

What posts are popular this week?

How is the site doing compared to last week?

Which pages were featured and on which social media platforms?

Spoiler: Neither tool can succinctly answer the third question. Ideally an analytics tool would display an “event”, some sort of marker on the timeline when a certain threshold of traffic from a source is met. I.e. I want to know that “Migrating from Wordpress to Static Markdown” was featured on /r/node.

I had already installed Countly on a VPS for keeping track of events generated by a mobile game I published, Cobalt Dungeon (this was a replacement for a massively overpriced event tracking system, Mixpanel). Having it installed was convenient because the server was already up and listening. I simply needed to create another “application” using their multi-tenant-friendly UI and I was ready to go.

Why Migrate

Honestly, it was mostly due to philosophical reasons. The Internet has become increasingly centralized over the years. I really want a website that someone can visit and all the resources are served by domains that I own. With this change I am much closer to that goal (though, most pages have an unobtrusive advertisement, those are still loaded from a third party).

The Migration

The initial installation of Countly isn't too difficult. They offer a pretty convenient One-Liner Countly Installation script. According to the documentation they suggest a server with 2GB of RAM. I ran Countly on such a server for several months, but eventually downgraded to a server with 1GB of RAM, and haven't encountered any issues so far.

The server that I use for Countly is a Linode 1GB Nanode VPS @ $5/mo. There's also an equivalent Digital Ocean 1GB Droplet VPS @ $5/mo. Both of these VPS offerings come with 1TB of transfer, 1 vCPU, and 25GB of SSD, all of which is plenty for an analytics service. DO is getting more popular recently but I chose Linode because I already have a VPS with them for hosting the rest of my projects.

Regardless of where you get your VPS from you should pick the most recent Ubuntu LTS. This will provide maximum compatibility with the install script and should come with plenty of security updates. Run the installer on a fresh installation and everything will be taken care of. You'll also want to go through the usual DNS and Lets Encrypt SSL setup.

Installing Countly on my site was pretty straightforward. Google Analytics provides an HTML snippet which can be copied and pasted into the layout of a website. Of course, Countly works the same way.

Right now I'm running the website with both GA and Countly. Once I get more traffic and am satisfied that there aren't too many discrepancies I'll shut GA off completely.

What got Better?

First of all, the Countly interface is much more intuitive than Google Analytics. For example it always takes me a few minutes to find the popular page list in GA.

Reduced bandwidth

As far as technical improvements go, the amount of data sent over the wire has decreased. My website already weighs in pretty low, so saving a few KB is a bigger deal with this site than with most sites.

Google Analytics:

/gtag/js 31.95 KB

/analytics.js 17.49 KB

collection event 458 B

Countly:

countly.min.js 8.08 KB

collection event #1 361 B

collection event #2 361 B

Network Traffic: Google Analytics vs. Countly

As you can see the difference is fairly high; GA usually consumes over 5x the amount of network traffic (about 50 KB vs 9 KB). Some of my pages only take 150 KB to load, sans analytics, so the savings are pretty nice. Another cool thing about Countly is that I'm able to host the analytics script from the main thomashunter.name domain.

Increased Event Tracking

Here are some numbers tracked over the past week, from December 20th to December 26th:

Countly Google Analytics Diff Total Sessions 1,633 1,268 +27% Total Visitors 1,349 1,120 +20%

Countly receives data for at least 20% more users than Google Analytics. Why might that be? I suspect both services keep track of sessions different, and both services perform different bot detection.

But, more likely, the highest contributor is going to be the different ad-blocking tools used by my visitors. These tools usually include a blacklist. Such a blacklist is more likely to contain the ubiquitous googletagmanager.com than my one-off analytics.phobosrising.co . And since my blog caters to a mostly technical audience the odds of them running ad-blocking tools is much higher than the average internet user.

What got Worse?

Some features about Countly are completely broken. The Traffic Sources screen is broken (it thinks everything is “direct” traffic, though this is supposedly fixed in an update). The Versions screen isn't useful for web (it's more for application versions). The Devices screen doesn't seem to know what an Android device is.

Possibly the biggest issue is that it costs more. Google Analytics doesn't have a monetary fee associated with it. However, the VPS costs $5/month, or $60/year.

Upgrading Countly is a time-consuming endeavor. GA, or any other SaaS solution, is going to be constantly updating itself behind the scenes. Upgrading Countly requires painful database migrations.

The issue which bothers me the least is that Countly displays less information. However, I didn't use 90% of the information that GA provides, so I'm not too worried about it.

If you're considering making the switch from one analytics platform to another then I would recommend writing a list of questions you need answered. Then, when evaluating alternatives, make sure the tool satisfies your needs.

Interface Screenshots

Here are a few graphical comparisons between the two tools. I personally find the Countly interface to be a little more modern. It also renders quicker than GA.

Overview

This first view is the overview, or dashboard view, of the system, showing some quick details for the selected timescale.

Countly Overview

Note that Countly comes with a Week over Week view. Google Analytics has another screen, containing mostly the same details as in this screenshot, but with a WoW timeline as well.

Google Overview

Page Listing

These two screens show the highest ranking pages based on popularity for the selected timescale.

Countly Page Listing

The two screens show basically the same information.

Google Page Listing