It's really fun using Google Analytics. You see how many (or how few) people have visited your site, where they looked, how much time they spent and much more fun stuff.

But it comes at a significant cost to your users: user privacy.

Here are some alternatives to using Google Analytics that will work for your Ghost blog, on WordPress, or on any website that lets you insert code.

In this guide I'll cover

  • Why you should consider an alternative to Google Analytics

Private information that Google Analytics collects about users

Google's tracking code, which you have to install on your website in order to use Google Analytics, sends information back to Google about the browser that has landed on the website.

According to Google's own website, Google collects:

  • Details about the browser and the computer making the request, including the hostname, browser type, referrer and language
  • Detailed system information, including Java and Flash support and screen resolution
  • Information about how the user spends time on the page ("session information") and ad campaign information
  • Advertising information, via the DoubleClick cookie

Can Google Analytics identify you?

It doesn't explicitly say it can. But there are a few ways it does.

Firstly, Google Analytics can identify individual users by IP address combined with other specific information it collects, hashing them into an identity. Say you visit one website and are tracked. You then visit another website. Both requests come from browsers with similar characteristics, so they're probably from the same person.

Secondly, if you're logged in to a Chrome browser as yourself, everything you do in that browser is linked to your identity.

Finally, the demographics tab in Google Analytics shows a TON of information it could be collecting. We haven't enabled those yet for our blog Discover Discomfort. But look at the stuff we could be collecting!

Google Analytics — not a privacy-focused web analytics tool

Quick tracking me! What ad blockers or browsers block Google Analytics?

There are a number of ways to block Google Analytics from working, if you're interested.

Firstly, you can use a privacy-focused browser. Firefox is heavily privacy-focused. Firefox Focus (one of the mobile options) is even more privacy focused, and is a popular choice on your browser. By default, both these browsers block all scripts and ads. A quick google for privacy-focused browsers brings up a number of options, but Firefox is probably your fastest, most reliable bet.

Secondly, you can block scripts with an alternative to AdBlock. Try AdGuard or uBlock Origin, and make sure you configure them to block tracking. I really like AdGuard, but that's just because I happy to install it (because AdBlock kept crashing, actually); uBlock Origin is a favourite for privacy types.

Finally, you can block scripts with a dedicated blocker. Try ScriptSafe for example. The main problem with this approach is that there are lots of scripts that do benign things, like let forms work, and you'd be preventing any of those from working. Webpages might not display or function as expected.

How to protect user privacy as website administrator

If you manage a website, consider using a non-tracking alternative to Google Analytics. I'm going to be experimenting with these on hooshmand.net and see what they do.

The following are the ones I'll try, in order of how awesome they are. Yes, my favourite is GoAccess, as it doesn't require any tracking codes. If you want to use rich behavioural tracking, use Matomo. Fathom looks fine, but I wouldn't recommend Simple Analytics.

My personal recommendation would be to use GoAccess combined with Matomo.

GoAccess - live, tracking-free server-side analytics

Go Access — privacy focused analytics dashboard reading web server data

GoAccess is how tracking originally used to be.

If you run a web server, you know what pages your web server is sending out. You get the requests directly! As a result, you have all the information on hand already, and all you have to do is serve it up visually.

You run GoAccess on your server as basically another web server, something like "analytics.hooshmand.net" (that's not a real thing). Then you configure GoAccess to read your server logs and tell you what people have been doing.

Pros of GoAccess privacy-focused analytics:

  • Uses your own server data — you don't have to install anything on your site
  • Fast — doesn't affect page speed

Cons of GoAccess

  • Needs a server: The main caveat is you have to have your own web server to run this, and it has to be one where you can install software. We run all our websites on DigitalOcean so this isn't a problem for us. If you use a host (like HostGator), or you use a managed service like SquareSpace, you won't be able to use GoAccess.
  • Not user-centric: The second main caveate of GoAccess is it's really all about you, and not about hte people visiting your site. This means you can't cookie people — for better or worse — to easily track uniques. If someone's IP address changes then you will think they're a different person.
  • Tricky to install — you have to download software and set up new things in your DNS.

Matomo - Liberating Web Analytics

Matomo is another analytics platform that's privacy focused for your blog.

Matomo — a complete privacy-focused analytics platform

Matomo is similar to Fathom (below). They have a standalone analytics service that you can either run self-hosted for free, or let them host for $9 a month (and up). Rather than try to offer everything in one page, like Fathom does, they offer pretty rich analytics, including

  • Media Analytics: Analyse how your audience watches and interacts with video
  • Content Interactions: clicks around the web pages
  • Transitions: analyse the previous and following actions of visitors for each page
  • "Row Evolution": see how any metric ("Row") in your report changes over time
  • Conversion Optimization: heat-maps, session recordings, funnels, A/B testing and other features
  • Visitor Profiles: a full lifetime journey of an individual visitor to the website
  • SEO analytics: unbiased search engine reporting, integrations with a number of search engines, eliminating "keyword not defined" in your reports. I don't know if GA is biased, but this makes it seem so!
  • Ecommerce goals tracking (sales)
  • Campaign Tracking: UTM codes and other parameters
  • Roll-Up Reporting: combine reporting from multiple websites

A principal differentiator is that they have a really need web-based installation process.

Piwik, the old name for Matomo
Matomo used to be called Piwik, I don't know why they haven't updated their graphics (as of when I wrote this blog)

One downside of Matomo is that unless you self-host, it will be blocked by ad blockers by default. This is true of any public system (depending on the ad blocker). So you have to self-host for it to work best.

Here's a guide by Ghost on installing Matomo.

Open Web Analytics - open-source self-hosted analytics

Open Web analytics privacy analytics platform

Open web analytics is another Github-hosted open souce application that you can use to track users.

Their website doesn't offer a secure certificate connection (November 2020), so I am a little dubious about how often it's updated. You can check out the project on Github here.

Count.ly - modern open source self-hosted analytics

Countly - an open-source analytics platform that's privacy-focused

Countly is aimed at commercial audiences and they only have two pricing plans — free self-hosted, and an expensive enterprise one.

The enterprise one gets you a lot of detailed analytics (like revenue, attribution, and funnels) — things that Google Analytics gives you already.

For free, you get basic tracking, events, and access to the apps and API.

Fathom Analytics - Simple, useful stats without tracking or storing user data.

Fathom, a privacy-focused analytics platform, dashboard screenshot

Fathom was set up in response to Google Analytics. They specifically claim to

  • Offer simple traffic insights
  • Not store personal user information
  • Offer simple setup
  • Be GDPR compliant

I'm really tempted, in particular, by the assertion that it's way simpler than Google Analytics.

Get all the information you need about how your website is performing from a single screen—there aren’t dozens of pages of reports to dig through. And it’s all built on modern, cloud-based technology, giving you simple, reliable and trustworthy details about how people are using your website. (from their main webpage)

Pros of Fathom Analytics are

  • Free if it's self-hosted, or starts at $14/mo for up to 100K visitors per month.
  • Open-source (you can find Fathom on Github)
  • Not blocked by tracking blockers or ad blockers

Cons of Fathom Analytics are

  • The installation process is a little scary if you're using the self-hosted version.
  • The pricing is $14/month (if you don't self-host), more expensive than Simple, with a 7 day free trial

Simple Analytics - Analytics without tracking

Screenshot of Simple analytics — simple privacy-focused analytics platform

I first found Simple Analytics in a post on Show HN. The creator was filling a gap he perceived to be in the market. The discussion was pretty interesting.

Pros of Simple Analytics:

  • Really clean dashboard (see their demo one), showing only the basics. In fact, they only show page views, referrers, top pages, and screen sizes.
  • Lightweight
  • Hosted in Netherlands (EU), and thus covered by EU privacy laws

Cons of Simple Analytics

  • There's no granularity about referrers for each page. This isn't enough granularity for me, so I doubt it is for others.
  • Not open source, unlike Fathom
  • Blocked by tracking software as it's externally hosted code
  • There's no self-hosted or free option — minimum is $9 a month with no free tier. This means that you have to pay to send information to the website admin, which is fine if you trust them, but that's a choice you have to make.

The founders of Simple Analytics seem like nice people with good intentions, and Simple Analytics is a huge improvement on Google Analytics. I'm just looking for something better.