Andrew's Blfog

You Don't Need 45KB of Tracking Code

Web Analytics are helpful, but not helpful enough for me to warrant quadrupling my blog's bandwidth costs.

I like having a general idea of how people are interacting with my sites, and how many people see them. Until I made this blog (and had a slight focus on low page size), I didn't really care to check how bulky Google Analytics was. Now I know.

Adding GA to a website will cost you around 45KB of network bandwidth if you use the recommended Google Tag Manager way.

On the extreme other end of the spectrum, Plausible Analytics weighs in at under 1KB, and offers a lot (most?) of the same information, with slight stat skewing; allegedly Plausible reports slightly higher (15%-ish) unique viewers, probably because it's a little more privacy-oriented and not nearly as aggressive in its session/user tracking.

Plasubile sounds great, but I'm garbage at using Docker and didn't want to pay for the SaaS version, so I installed Umami, which is almost as lightweight (I think the analytics script ends up being around 2KB) and can use MySQL. The rest of those analytics softwares seem to use Postgres, which I don't have installed and configured (and didn't feel like doing so)

Dashboard of Umami - not bad!

So far, it's not bad. It gives me most of the information I care about (other than screen size) and gives me a pretty good idea of what site usage is looking like.

Honorable mention: Shynet looked nice (tiny tracking script, nice graphs), but since I'm terrible at using Docker and don't have Postgres installed, I passed on it. Maybe if Umami ends up not working out, though?

Server-side analytics

Another alternative that's significantly more lightweight (sometimes 0 added code, or if you use a tracking pixel it can be extremely minimal code) is server-side analytics, where everything is tracked via the backend and works off of what the server can know.

The downside to this is identifying browser, region, device type, tracking active session, etc are all much more difficult or impossible without introducing client-side code. Great for solutions where you need extremely minimal information (how many times x page has been requested, for example) but not great when you want session tracking, time tracking, and more accurate browser/os/device demographic info.