How does cookie-less web analytics count unique visitors without storing cookies?
Cookie-less web analytics counts unique visitors without setting cookies or localStorage by hashing transient request metadata (site ID, IP address, and user agent) with a random server-side salt rotated every 24 hours UTC. Raw IP addresses are discarded in memory immediately, keeping unique visitor counts accurate within each day while preventing cross-day or cross-site tracking.
- Cookie-less hashing writes 0 bytes to the visitor browser, avoiding ePrivacy Directive Article 5(3) terminal-storage consent walls for basic analytics.
- Rotating a 32-byte server-side salt every 24 hours UTC makes historical SHA-256 visitor hashes mathematically irreversible once the salt expires.
- Cookie-less mode measures daily unique visitors, sessions, active dwell time, referrers, UTMs, and goals accurately, but cannot link a visitor across separate weeks.
- Dual-mode identity keeps marketing sites cookie-less while letting SaaS apps opt in to first-party IDs or identify() for multi-week cohorts and 90-day attribution.
Why legacy cookie analytics breaks on modern websites
Traditional analytics platforms were designed in an era when dropping a two-year _ga cookie on every visitor device faced zero regulatory or browser friction. That architecture now fails on three fronts simultaneously: European consent walls, browser tracking prevention, and Core Web Vitals budgets.
Under Article 5(3) of the EU ePrivacy Directive, writing or reading non-essential data on a user's terminal device requires prior informed consent. Because cookie-based analytics stores persistent identifiers inside document.cookie, site owners must block tracking until visitors actively click "Accept" on a consent banner.
On equal-choice consent banners across Europe, 35% to 70% of visitors either reject optional cookies or ignore the banner altogether. Developer and B2B SaaS audiences reject tracking at the highest end of that range, leaving marketing teams making budget decisions from less than half of their real traffic.
Why cookie banners blind traditional analytics vs zero-storage measurement
Illustrative percentage of non-bot EU human visits captured under strict opt-in consent
Requiring cookie consent for basic pageviews typically hides 35% to 70% of European visitors, distorting referrer and landing-page conversion math.
Methodology: Illustrative visibility bands comparing zero-storage measurement against widely reported European equal-choice cookie banner acceptance rates (30% to 65%).
View chart data table
| Label | Non-bot human visits measured |
|---|---|
| Cookie-less analytics (zero terminal storage) | 100% |
| Cookie banner with soft opt-in (upper benchmark) | ~65% |
| Strict EU equal-choice banner (median benchmark) | ~45% |
| Strict privacy-focused developer audience | ~30% |
Cookie bloat also drags down page speed. Loading a 35 to 45 KB gzipped gtag.js library, or 135+ KB when wrapped inside Google Tag Manager with advertising signals, competes directly with application hydration on mobile connections.
How daily-salt SHA-256 hashing works under the hood
Cookie-less analytics solves the consent and privacy problem by moving visitor deduplication from the user's browser into ephemeral server memory. Zero bytes are written to document.cookie, localStorage, sessionStorage, or IndexedDB.
When a visitor loads a page running TrimStats t.js, the browser transmits a minimal POST /v1/collect beacon containing the site public key, page URL, referrer, UTM parameters, and active dwell duration. On the collector server in Nuremberg, Germany, the pipeline derives an opaque 64-bit unsigned integer (visitor_id) using a strict cryptographic sequence:
// Server-side daily visitor hash derivation (in-memory only)
const dailySalt = await valkey.get(`salt:${utcDate}`); // 32 random bytes, 24h TTL
const rawInput = `cl:${dailySalt}:${siteId}:${clientIp}:${userAgent}`;
const visitorId = sha256ToUint64(rawInput);
// clientIp is discarded immediately after GeoIP country lookup and hashing
Three design guarantees make this approach fundamentally different from invasive browser fingerprinting:
- Zero terminal device storage: The browser never stores a persistent token, satisfying the core condition that triggers ePrivacy consent banners.
- Irreversible daily expiry: The 32-byte server salt expires automatically at UTC midnight. Once discarded, nobody (including the analytics vendor) can reconstruct the original IP address or link Tuesday's hash back to Monday's visit.
- Site isolation: Because
siteIdis mixed into every hash, the same person visiting two different TrimStats customer domains receives two completely unrelated integers. Cross-site profiling is structurally impossible.
What cookie-less analytics measures accurately every day
A common misconception among marketers migrating from Google Analytics 4 is that removing cookies blinds core reporting. In reality, almost every acquisition, content, and same-session conversion metric works at full precision inside a daily salt boundary.
| Metric or Report | Accuracy in Cookie-less Mode | Underlying Calculation Rule |
|---|---|---|
| Live visitors | Exact (5-minute rolling window) | Valkey sorted set (live:{siteId}, 300 s TTL) |
| Daily unique visitors | High (deduplicated per UTC day) | uniqCombined64(visitor_id) in ClickHouse |
| Sessions | Exact (30-min inactivity timeout) | Sliding session_id UUID refreshed on each event |
| Bounce rate | More accurate than legacy GA | pageviews <= 1 AND active duration_ms < 10,000 |
| Active visit time | High (visibility-aware) | Pauses timer when browser tab is hidden |
| Top pages, referrers, UTMs | Exact | Parallel ClickHouse top-25 breakdowns with click filters |
| Custom events & goals | Exact | Up to 50 pageview or event conversion goals per site |
| Opt-in UI click friction | Exact | Compact CSS selector hints (rage_click, dead_click, 90% scroll) |
Notice how visibility-aware bounce rate fixes a classic analytics distortion. On a technical blog post or documentation page, a visitor often lands from Google, reads for four minutes, copies a snippet, and closes the tab. Legacy single-pageview bounce rules label that visit a 100% bounce; TrimStats requires both <= 1 pageview AND < 10 seconds of active tab focus before counting a bounce.


Where pure cookie-less analytics hits a mathematical ceiling
Honest engineering requires naming what cookie-less analytics cannot do. Because the server discards yesterday's salt at midnight UTC, pure cookie-less measurement has three hard boundaries:
- Multi-week retention cohorts: Calculating what percentage of October 19 signups returned in Week 4 requires knowing that the visitor in Week 4 is the same entity from Week 0.
- Multi-day conversion funnels: Measuring a funnel where a prospect reads a comparison page on Monday and creates an account on Friday requires a persistent identifier spanning more than 24 hours.
- Long-window first-touch attribution: B2B SaaS buyers routinely evaluate a product over 14 to 60 days before entering a credit card. Without persistent state or user identification, a purchase three weeks later falls back to same-session checkout metadata rather than the original Day 1 referrer.
Maximum lookback window (days) by TrimStats identity mode
ClickHouse journey depth across cookie-less, opt-in first-party, and identified modes
Cookie-less mode excels for same-day acquisition and conversion measurement, while opt-in persistent modes unlock 30-day funnels and 90-day attribution.
Methodology: Exact ClickHouse query lookback parameters documented in TrimStats canonical specifications (apps/web/lib/content/facts.ts).
View chart data table
| Label | Revenue attribution lookup | Funnel conversion window |
|---|---|---|
| Cookie-less (default) | 1d (+ meta) | 1 day |
| First-Party ID (opt-in) | 90 days | 30 days |
| Identified (identify) | 90 days | 30 days |
Pure cookie-less tools force an uncomfortable choice: give up SaaS cohort and 90-day attribution visibility forever, or bolt on a second bloated product-analytics SDK inside your web app.
Dual-mode identity: the practical architecture for SaaS teams
TrimStats resolves that trade-off with per-site dual-mode identity enforced on both the browser script and the collector backend. Every site starts strictly cookie-less out of the box, and the collector enforces a strict three-tier identity resolution order:
- Identified (
identified): When your authenticated web app callswindow.trimstats('identify', userId)with an opaque database UUID, the collector hashesuid:{siteId}:{userId}. - First-party (
first_party): Only when both the dashboard toggle in Site settings ANDdata-mode="first-party"in your HTML tag are active,t.jsstores a random first-party UUID inlocalStorage._ts_vidand a first-touch snapshot inlocalStorage._ts_attr. - Cookie-less (
cookieless): For every other visitor, the collector falls back automatically to the 24-hour rotating daily salt hash.


This architecture supports two clean deployment patterns:
- Pattern A (Marketing cookie-less + App identified): Keep your public website, guides, and blog strictly cookie-less with zero consent banner. Inside your authenticated SaaS app (where users already accepted your product terms and privacy notice), call
identify(user.id)to unlock weekly retention cohorts and chronological timelines. - Pattern B (Consent-gated first-party upgrade): Load the default cookie-less snippet for everyone on initial load. If a visitor opts in via an existing consent banner, activate
data-mode="first-party"for that user while keeping declined visitors in zero-storage cookie-less mode.
How to audit any analytics script in Chrome DevTools
Before trusting any vendor's privacy claims, verify the script yourself in two minutes inside Chrome DevTools:
- Check Application -> Cookies & Local Storage: Load your page in an Incognito window with the script installed. In strict cookie-less mode, both Cookies and Local Storage for your origin must show zero entries written by the analytics script.
- Check Network -> Transfer Size: Filter for
t.js, reload with cache disabled, and inspect the transferred bytes column. TrimStats transfers1,964 Bgzipped (1,732 BBrotli) with zero chained secondary script downloads. - Check Network -> Beacon Preflight: Inspect the
POST /v1/collectcall. TrimStats submits beacons withContent-Type: text/plainvianavigator.sendBeaconso the browser skips the extra CORSOPTIONSpreflight round trip and receives HTTP202 Accepted. - Verify EU Infrastructure & DPA: Confirm where analytics storage and relational metadata reside. TrimStats processes ClickHouse and Valkey telemetry on Hetzner in Nuremberg, Germany, and PostgreSQL metadata on Neon in Frankfurt, Germany.
Handling SPAs, bot traffic, and referrer stripping cleanly
Cookie-less accuracy depends as much on data hygiene as on hashing math. Three real-world browser behaviors routinely distort naive traffic dashboards if the collector does not account for them:
Client-side SPA route transitions
Modern frameworks such as Next.js App Router, React Router, Vue Router, and Astro View Transitions change the browser URL via history.pushState without triggering a full HTML document reload. If a tracker fires only on initial DOMContentLoaded, every internal page transition disappears and bounce rates skyrocket artificially.
TrimStats patches history.pushState and subscribes to popstate automatically inside t.js. On every virtual navigation, the tracker flushes active dwell time for the departing route, resets the 90% scroll reach flag, and dispatches a fresh pageview beacon for the incoming pathname with zero manual framework hooks.
Automated crawlers and headless browsers
Unfiltered search crawlers, uptime monitors, and AI fetchers can inflate monthly pageview totals by 20% to 40% while wrecking conversion rates. TrimStats drops automated traffic in two layers: first in the browser (if (navigator.webdriver) return;), and second inside the Fastify collector using known bot User-Agent filters before rows enter ClickHouse or increment monthly billing counters.
Cross-origin referrer policy and UTM preservation
Modern browsers default to strict-origin-when-cross-origin, stripping full referring URL paths down to the origin domain (for example news.ycombinator.com or github.com). While origin-level referrers work well for organic discovery, email newsletters, mobile apps, and paid social campaigns often strip referrers completely. Tag outbound campaign links consistently with utm_source, utm_medium, and utm_campaign so ClickHouse attributes campaign performance accurately even when document.referrer arrives empty.
Evaluating EU residency and GDPR data processor responsibilities
Running cookie-less removes terminal-storage consent friction, yet site owners still hold GDPR Data Controller obligations whenever personal data or online identifiers pass through a vendor server. Before approving any analytics tool during a security review, verify four infrastructure guarantees:
- Physical EU data storage: Both raw analytical events and account metadata remain inside European Economic Area data centers rather than replicating to US cloud regions.
- No raw IP retention: Confirm in writing inside the vendor's Privacy Policy and Data Processing Agreement (DPA) that IP addresses are used solely in volatile RAM and never written to database tables, object storage, or reverse-proxy access logs.
- Zero data resale or ad-network sharing: Confirm the vendor operates strictly as a GDPR Article 28 Data Processor on your behalf rather than claiming joint-controller rights to enrich cross-site advertising graphs.
- Built-in deletion and retention windows: Verify that historical event partitions expire cleanly according to your documented retention window (365 days on TrimStats Starter through 1,095 days on Scale) and that deleting a site purges associated analytics data.
If you want to connect your cookie-less marketing site directly to verified subscription revenue without relying on browser pixels, continue with our SaaS Revenue Attribution Guide or review TrimStats vs Google Analytics 4.
Frequently asked questions
Does cookie-less web analytics use browser fingerprinting?
Do I still need a cookie consent banner in the EU if I use cookie-less analytics?
How accurate are unique visitor counts when salts rotate every 24 hours?
What happens if a visitor switches from Wi-Fi to cellular data mid-session?
When should a SaaS team turn on opt-in First-Party ID mode instead of staying cookie-less?
How does cookie-less web analytics behave under Safari ITP and Firefox Enhanced Tracking Protection?
Can cookie-less analytics attribute Stripe, Paddle, or Polar revenue accurately?
Sources & references
- CNIL Guidance on Audience Measurement Exemption from ConsentAccessed 2026-11-30
- EUR-Lex ePrivacy Directive 2002/58/EC (Article 5(3) Terminal Storage)Accessed 2026-11-30
- TrimStats Dual-Mode Identity & Daily Salt Technical DocumentationAccessed 2026-11-30
Co-founder of DotCamp LLC in Brooklyn, NY and lead engineer of TrimStats. Ships privacy-first web analytics, ClickHouse pipelines, and WordPress plugins used on 115,000+ active sites.
- • Architect of the TrimStats 1.96 KB gzipped browser tracker, Fastify collector, and ClickHouse MergeTree pipeline
- • Co-founder of DotCamp LLC (est. 2019), creator of Ultimate Blocks (50,000+ installs), WP Table Builder (50,000+ installs), Tableberg, and OptimizeCamp
- • WordPress.org plugin & theme developer since 2016 with 1,200+ community support replies and 5M+ cumulative plugin downloads
Verification standard: Systems architecture: Built directly on TrimStats production hashing priority (identified, first_party, cookieless), 32-byte UTC salt rotation, and verified 1,964 B gzipped tracker build.
Continue reading
Measure traffic, revenue, and UI friction in 1.96 KB gzipped
Cookie-less by default, powered by ClickHouse, and starting at $17/month for 100,000 monthly events with every feature unlocked.