Self-hosted analytics: How to track 53% more views

Last month, I released a new project, designed to teach players to how learn grenade lineups in the video game Counter-Strike 2. It had a succesful launch, with over 600,000 page views in it's first month.

During development, I enabled Cloudflare Web Analytics to the domain, since I was already using Cloudflare Pages for static web hosting. This was a simple and easy solution to tracking visits, page views, and some performance metrics. Cloudflare Web Analytics is designed to not require cookies (no popups!), and designed to respect users privacy, unlike Google Analytics.

Cloudflare Web Analytics Dashboard

As you can see, the launch went pretty well! These stats are from a few weeks after the launch, and good growth in page views can still be seen.

However, when I visit the site using any tracker- or ad-blockers, I noticed the Cloudflare analytics script being block. This meant that many of my users were also blocking the script, which meant lots of page views weren't being tracked.

Cloudflare Script Being Blocked

To fix this, I decided to setup Plausible, another privacy-friendly analytics solution. Since it is open-source, I self-hosted it instead of subscribing to their cloud offering (since this is a side-project, my budget is tight, and the hosted option would have cost $69/month). I wasn't too worried about bypassing user's tracking blockers as this doesn't record any PII (it only records page path, browser, country, and visit duration).

After setting up the script and waiting some time, I compared the results for the same period above:

Plausible Dashboard

53% more page views over a 3 week period! That's a significate enough amount of data which could affect any data-driven decisions made based on the non-self-hosted option (Cloudflare in this case, but this also would apply to Google).

Avatar

Who am I?

Hi, I'm @Cretezy (also known as Charles), a software developer. I write about programming, personal projects, and more. I also make YouTube videos.

See more articles here, or view the home page