← Blog

Installing Website Analytics With One Script Tag

SaaSNa.me · September 9, 2026

Most analytics installs involve more than analytics: a tag manager, a consent library gating it, an environment config, and a verification step before the first pageview shows up. A cookieless tool can skip most of that, because there's no consent state to manage and nothing to configure per environment.

What the script actually needs to do

Three things, in order, on every pageview:

1. Read the current path and referrer. 2. Send them to a collection endpoint, along with nothing else — no identifiers to generate client-side, since identity is derived server-side from request headers, not from anything the script computes. 3. Do it without blocking render, so a slow or failed analytics request never affects the page the visitor actually came for.

That's small enough to ship as a single script tag with no dependencies, which is why installing it is one paste, not a setup wizard.

Where it goes

The script belongs in `<head>`, loaded with `async` or `defer` so it never delays the page's own content. There's no tag-manager container to configure first and no consent gate to wire it behind, because there's nothing the script does that requires consent.

How to verify it worked

The fastest check isn't waiting for tomorrow's report — it's opening the site's live dashboard in a second tab immediately after installing and loading the page once. A cookieless live count updates within the current 30-minute window, so a successful install shows up as "1 visitor, right now" within seconds, not after an overnight batch job.

What "done" looks like

If the script is in `<head>`, loads asynchronously, and the live dashboard shows the test pageview, the install is complete. There's no cookie consent category to add, no CMP to configure around it, and no separate event schema to define before the first number appears — visitors, referrers, and countries start populating from that first pageview onward.