How to add website analytics without a cookie consent banner
A practical, step-by-step guide to actually setting this up — not just a checklist of what triggers consent, but how to get it right.
Most guides on this topic explain what triggers a cookie banner in the abstract. This one is the other half: the actual steps to set up analytics that genuinely doesn't need one, plus how to check your own work instead of taking a vendor's word for it.
Step 1: Pick a tool that doesn't set a persistent identifier
The requirement isn't about the word "analytics" — it's specifically about storing anything on a visitor's device that can identify them across sessions. Before picking a tool, check whether it sets a cookie or writes a persistent value to localStorage that survives a closed tab. If it does, you need a banner regardless of what the marketing page says. Embaze doesn't (see our post on how the mechanism actually works), and neither do most other tools in this category — but verify it for whichever one you choose, not just this one.
Step 2: Install the script, and stop there
This is the part that surprises people coming from Google Analytics: there's no consent-gating code to write around it. No checking a cookie-consent state before loading the script, no conditional initialization after someone clicks "Accept." If the tool genuinely doesn't need consent, wrapping it in consent logic anyway is dead code that does nothing but add complexity.
Step 3: Verify it yourself
Don't trust a "cookie-free" claim without checking it — it takes two minutes in your browser's dev tools:
- Open dev tools → Application (Chrome) or Storage (Firefox) → Cookies for your domain. After loading your site, it should be empty — no analytics cookie should appear.
- Check the Network tab for the request the tracking script sends. Look at the request headers — there shouldn't be a Cookie header attached to it.
- Reload the page and check whether any value in localStorage or sessionStorage persists across a real browser restart, not just a refresh. sessionStorage-based session IDs should vanish once you fully close and reopen the browser.
Step 4: Don't stop at the analytics tool
This is the mistake that undoes all of the above: swapping your analytics tool for a cookie-free one, removing the banner, and leaving an ad pixel or a session-replay tool still running underneath it. Consent requirements are about your whole stack, not any single tool in it — see our checklist post for what else on a typical site needs checking before you can honestly remove the banner entirely.
Done right, the end state is genuinely simple: one script tag, no banner, no consent logic anywhere in your codebase — because nothing on the page is asking for permission it doesn't need.