privacy analytics9 min read

How Cookie-less Web Analytics Works & Its Limits

A technical guide to cookie-less web analytics: 24-hour rotating SHA-256 salts, ePrivacy consent boundaries, Core Web Vitals, and dual-mode SaaS tracking.

Imtiaz Rayhan
Imtiaz RayhanCo-Founder & Lead Engineer, DotCamp & TrimStats
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.(packages/tracker/dist/t.js)
Direct answer

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.

Key takeaways
  • 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.

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.

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.

Cookie-less trackers ship 18x to 68x smaller than cookie-based GA4 stacks

Compressed network transfer size in kilobytes (KB, gzipped)

KB
TrimStats t.js (all features)(1,964 B measured)
1.96 KB1x baseline
Umami script.js(published spec)
~2.0 KB1x baseline
Fathom script.js(gzipped range)
~2.1-2.7 KB1.2x
Google Analytics 4 (base gtag.js)(without GTM)
~35-45 KB20.4x
GA4 + Google Tag Manager + Signals(full ad stack)
~135 KB68.9x

Lightweight cookie-less scripts eliminate 33 to 133+ KB of third-party JavaScript transfer on every page load.

Methodology: TrimStats measured directly from built packages/tracker/dist/t.js (1,964 B gzipped). Third-party ranges reflect verified vendor specs and public transfer benchmarks.

View chart data table
LabelGzipped transfer size
TrimStats t.js (all features)1.96 KB
Umami script.js~2.0 KB
Fathom script.js~2.1-2.7 KB
Google Analytics 4 (base gtag.js)~35-45 KB
GA4 + Google Tag Manager + Signals~135 KB

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:

  1. Zero terminal device storage: The browser never stores a persistent token, satisfying the core condition that triggers ePrivacy consent banners.
  2. 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.
  3. Site isolation: Because siteId is mixed into every hash, the same person visiting two different TrimStats customer domains receives two completely unrelated integers. Cross-site profiling is structurally impossible.

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 ReportAccuracy in Cookie-less ModeUnderlying Calculation Rule
Live visitorsExact (5-minute rolling window)Valkey sorted set (live:{siteId}, 300 s TTL)
Daily unique visitorsHigh (deduplicated per UTC day)uniqCombined64(visitor_id) in ClickHouse
SessionsExact (30-min inactivity timeout)Sliding session_id UUID refreshed on each event
Bounce rateMore accurate than legacy GApageviews <= 1 AND active duration_ms < 10,000
Active visit timeHigh (visibility-aware)Pauses timer when browser tab is hidden
Top pages, referrers, UTMsExactParallel ClickHouse top-25 breakdowns with click filters
Custom events & goalsExactUp to 50 pageview or event conversion goals per site
Opt-in UI click frictionExactCompact 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.

Seeded demo workspace
TrimStats Overview dashboard running in strict cookie-less mode with 42 live visitors, 29,991 unique visitors, 36.8% bounce rate, and 2m 28s active visit timeTrimStats Overview dashboard running in strict cookie-less mode with 42 live visitors, 29,991 unique visitors, 36.8% bounce rate, and 2m 28s active visit time
Real-time visitors, visibility-aware dwell time, bounce rate, and click-to-filter breakdowns work cleanly with zero cookies or localStorage writes.

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

days
Revenue attribution lookup
Funnel conversion window
Maximum lookback window (days) by TrimStats identity modeCookie-less mode excels for same-day acquisition and conversion measurement, while opt-in persistent modes unlock 30-day funnels and 90-day attribution.0234568901d (+ meta)1 dayCookie-less (default)90 days30 daysFirst-Party ID (opt-in)90 days30 daysIdentified (identify)

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
LabelRevenue attribution lookupFunnel conversion window
Cookie-less (default)1d (+ meta)1 day
First-Party ID (opt-in)90 days30 days
Identified (identify)90 days30 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:

  1. Identified (identified): When your authenticated web app calls window.trimstats('identify', userId) with an opaque database UUID, the collector hashes uid:{siteId}:{userId}.
  2. First-party (first_party): Only when both the dashboard toggle in Site settings AND data-mode="first-party" in your HTML tag are active, t.js stores a random first-party UUID in localStorage._ts_vid and a first-touch snapshot in localStorage._ts_attr.
  3. Cookie-less (cookieless): For every other visitor, the collector falls back automatically to the 24-hour rotating daily salt hash.
Seeded demo workspace
TrimStats Privacy and Identity settings comparing default zero-storage Cookie-less mode against optional First-Party ID mode hosted in Nuremberg and FrankfurtTrimStats Privacy and Identity settings comparing default zero-storage Cookie-less mode against optional First-Party ID mode hosted in Nuremberg and Frankfurt
Per-site identity controls keep marketing properties strictly cookie-less while allowing SaaS applications to opt in to persistent journeys explicitly.

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:

  1. 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.
  2. Check Network -> Transfer Size: Filter for t.js, reload with cache disabled, and inspect the transferred bytes column. TrimStats transfers 1,964 B gzipped (1,732 B Brotli) with zero chained secondary script downloads.
  3. Check Network -> Beacon Preflight: Inspect the POST /v1/collect call. TrimStats submits beacons with Content-Type: text/plain via navigator.sendBeacon so the browser skips the extra CORS OPTIONS preflight round trip and receives HTTP 202 Accepted.
  4. 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?
No. Browser fingerprinting probes canvas rendering, installed fonts, audio contexts, WebGL hardware strings, and battery APIs to build a permanent cross-site identifier. Cookie-less analytics reads only standard HTTP request headers (IP address and User-Agent) in server memory, mixes them with a daily rotating 32-byte salt, and discards the IP immediately so tracking resets every 24 hours.
Do I still need a cookie consent banner in the EU if I use cookie-less analytics?
In default cookie-less mode, TrimStats writes zero cookies and zero localStorage keys to the visitor device and never shares data with ad networks, so an analytics cookie banner is typically not required under ePrivacy terminal-storage rules. Always review your full site stack because other scripts such as chat widgets or ad pixels may still set cookies.
How accurate are unique visitor counts when salts rotate every 24 hours?
Within any single UTC day, unique visitor counts, sessions, pageviews per session, and bounce rates are highly accurate because the same visitor produces the same daily hash throughout the day. Across multi-day date ranges such as 30 days, a visitor returning on two separate days counts as one unique daily visitor on each day unless opt-in first-party mode is enabled.
What happens if a visitor switches from Wi-Fi to cellular data mid-session?
In strict cookie-less mode, changing IP addresses produces a new daily hash because the server cannot store a persistent client identifier on the device. In practice, this edge case represents a tiny fraction of desktop and SaaS evaluation sessions and is the intentional privacy trade-off of avoiding browser storage.
When should a SaaS team turn on opt-in First-Party ID mode instead of staying cookie-less?
Keep marketing pages, docs, and blogs strictly cookie-less. Enable First-Party ID mode or call window.trimstats("identify", userId) inside your web app only when you need 2 to 12 week retention cohorts, 30-day multi-step funnels, or 90-day multi-touch revenue attribution across separate days.
How does cookie-less web analytics behave under Safari ITP and Firefox Enhanced Tracking Protection?
Because strict cookie-less analytics writes zero cookies and zero localStorage keys, Safari Intelligent Tracking Prevention (ITP) 7-day script-storage eviction has zero effect on daily unique visitor hashing. Daily hashes are computed transiently on EU servers from standard HTTP request metadata and discarded on rotation.
Can cookie-less analytics attribute Stripe, Paddle, or Polar revenue accurately?
Yes for same-session purchases. Even when a site stays strictly cookie-less, window.trimstats.attribution() passes the referrer, landing page, and UTM parameters into checkout metadata so server-verified webhooks attribute the purchase cleanly. Opting in to first-party ID mode or identify() extends lookup to 90 days.

Sources & references

Imtiaz Rayhan
Written & verified by
Imtiaz Rayhan (Co-Founder & Lead Engineer, DotCamp & TrimStats)

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.

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.