What Really Runs When You Add Analytics?
Many website owners add analytics scripts without fully understanding what actually runs in the browser. To highlight the difference, let's compare two analytics approaches: Queantic — a minimalist tracking pixel — and Simple Analytics, a popular lightweight analytics script.
Queantic: 96 Bytes of Tracking
Queantic uses a remarkably simple technique to track pageviews and user visits — just a single image tag with an onerror
attribute. Here is the entire snippet you add to your site:
<img onerror=src='//qntc.it/t/586c45fa?'+location src>
Here’s what happens when a browser encounters this tag:
-
The browser tries to load the image, but the
src
attribute is left empty on purpose, causing it to fail instantly. This failure isn't a mistake — it's a trick to activate the next line of logic while keeping the code extremely short. -
The
onerror
handler runs as a result. It dynamically sets a newsrc
that points to our tracking endpoint, appendinglocation
— which is JavaScript shorthand for the current page’s full URL. This captures where the hit came from without any extra setup. -
The updated
src
triggers a second image load — this time successfully — and silently sends your visit data to the tracking server. The closingsrc
at the end finalizes the tag structure and ensures it's valid HTML. No scripts, no bloat — just 96 bytes of precision.
This approach results in an extremely lightweight tracking footprint — under 100 bytes — without any additional JavaScript or complex logic.
Simple Analytics: What’s Really in latest.js
On the surface, Simple Analytics appears simple. You add a single script tag to your HTML, like so:
< src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
But beneath this innocuous line lies a full-fledged analytics engine consisting of over 200 lines of JavaScript, executing every time a visitor loads your page. Here’s a unminified snapshot of what Simple Analytics’s script does:
long script example
As you scroll through this seemingly endless chunk of code, ask yourself: is all this really necessary? From event tracking and scroll depth detection to engagement timers, visibility listeners, and SPA routing logic — this script is doing a lot more than simply recording a pageview.
All of it runs on every page load, in every user’s browser, just to send basic analytics data. For a service that claims to be simple and privacy-friendly, that's a surprising amount of bloat.
Queantic offers the same insights—without the baggage. Take a look at our demo.