What technical controls make web analytics privacy-friendly under GDPR and ePrivacy rules?
Privacy-friendly web analytics under GDPR and the EU ePrivacy Directive requires six core technical controls: zero client cookies or localStorage in default mode, immediate in-memory IP discarding with 24-hour rotating cryptographic salts, EU data residency in Germany or EEA servers, a signed Article 28 Data Processing Agreement, zero cross-site ad sharing, and strict PII hygiene in URLs and user IDs.
- Separate ePrivacy Article 5(3) terminal-storage rules (cookies and localStorage) from GDPR personal-data processing obligations when auditing any analytics vendor.
- Verify that raw visitor IP addresses are discarded in volatile RAM after country lookup and salted SHA-256 hashing rather than written to ClickHouse or web server logs.
- Audit every sub-processor in your vendor DPA so analytics events, relational metadata, and backups remain inside documented EU regions.
- Keep raw email addresses, session tokens, and passwords out of URL query parameters, custom event properties, and identify() user IDs.
Why engineers should separate ePrivacy from GDPR
Most web analytics privacy discussions blur two distinct European laws together, leading teams either to add unnecessary consent walls or to overlook real server-side obligations.
- ePrivacy Directive (Article 5(3)) regulates reading or writing non-essential information on the visitor's terminal device (
document.cookie,localStorage,IndexedDB, or device-fingerprinting APIs). This rule is what forces cookie consent banners. - GDPR (Regulation 2016/679) regulates how personal data and online identifiers are processed on your servers and your vendors' servers, including legal basis, data minimization, EU cross-border transfers, storage limitation, and Article 28 Data Processing Agreements.
Building an audit-ready analytics setup means satisfying both layers with verifiable technical controls rather than relying on vague marketing badges.
Browser storage keys written per visitor across common analytics setups
Count of persistent cookies or localStorage keys written on initial page load
Zero persistent storage keys in default cookie-less mode eliminates the client-storage trigger that forces analytics consent banners across Europe.
Methodology: TrimStats storage keys verified from packages/tracker/src/index.ts. GA4 core cookie definitions verified from Google Analytics developer documentation.
View chart data table
| Label | Persistent browser keys |
|---|---|
| TrimStats Cookie-less (default) | 0 keys |
| TrimStats First-Party ID (opt-in) | 2 keys |
| Google Analytics 4 (core gtag.js) | 2+ cookies |
| GA4 + Tag Manager + Ad Pixels (typical) | 8+ cookies |
The 12-point engineering checklist for EU-ready analytics
Use this checklist when evaluating a new analytics platform or preparing a SaaS product for European enterprise security questionnaires.
Layer 1: Browser and terminal-storage controls
- Zero cookies and zero
localStorageby default: Load your public marketing site, docs, and blog in a fresh Incognito tab and verify under DevTools -> Application that the analytics tag writes0cookies and0storage keys. - No invasive browser fingerprinting: Confirm the script never calls Canvas 2D hashing, WebGL renderer enumeration, AudioContext fingerprinting, or installed-font probing to manufacture permanent cross-site IDs.
- Explicit opt-in for persistent journeys: If your SaaS product requires multi-week retention cohorts or 90-day attribution, enforce persistence with an explicit per-site toggle on both client and server (
data-mode="first-party"plus the dashboard toggle in TrimStats). Never silently fall back to cookies when storage is disabled. - Strict opt-out support for internal teams: Provide a clean client-side opt-out mechanism (
localStorage.setItem('trimstats_ignore', '1')) and drop automatednavigator.webdriversessions before dispatch.


Layer 2: Server-side IP handling and cryptographic isolation
- Discard raw IP addresses in volatile RAM: The ingestion server may read the client IP transiently in memory to resolve a two-letter country code and compute a daily salted hash, then discard the IP immediately without writing it to ClickHouse, PostgreSQL, or reverse-proxy access logs.
- Rotate cryptographic salts every 24 hours UTC: Confirm the collector mixes a random 32-byte daily salt (
salt:YYYY-MM-DD) intoSHA-256(salt + siteId + clientIp + userAgent)and expires yesterday's salt automatically so historical hashes cannot be linked across days or reversed. - Isolate visitor hashes per domain: Including
siteIdinside the hash input guarantees that the same person visiting two separate customer websites receives completely unrelated visitor IDs, making cross-site behavioral profiling impossible. - Zero ad-network data sharing: Verify in the vendor Terms of Service and Privacy Policy that the analytics provider acts strictly as a GDPR Article 28 Data Processor and never pools, sells, or shares telemetry with advertising exchanges or AI model training pipelines.
Layer 3: EU infrastructure, retention, and contractual governance
- Verify physical EU data residency for every datastore: Confirm where both high-volume analytics tables and account metadata reside. TrimStats hosts ClickHouse, Valkey, and the Fastify collector on Hetzner Online GmbH in Nuremberg, Germany, and relational PostgreSQL metadata on Neon in Frankfurt, Germany.
- Document explicit retention windows: Under GDPR Article 5(1)(e) (storage limitation), personal or pseudonymous records should not be kept indefinitely without justification. Record exact plan retention bounds in your Privacy Policy and RoPA (for example 365 days on TrimStats Starter through 1,095 days on Scale).
Explicit data retention limits support GDPR storage-limitation governance
Documented analytics history retention in days across TrimStats plans vs GA4 Explorations
Documented retention windows let privacy teams state exact expiration timelines inside their Records of Processing Activities (RoPA).
Methodology: TrimStats retention windows imported from packages/shared/src/schemas.ts (PLANS). GA4 Exploration retention limits sourced from Google Analytics 4 documentation.
View chart data table
| Label | Retention window |
|---|---|
| GA4 Exploration default | 60 days (2m) |
| TrimStats Starter ($17/mo) | 365 days |
| GA4 Exploration maximum | 14 months |
| TrimStats Growth ($44/mo) | 730 days (2y) |
| TrimStats Scale ($134/mo) | 1,095 days (3y) |
- Execute an Article 28 Data Processing Agreement (DPA): Store a signed or accepted copy of your analytics vendor's DPA (available at
/legal/dpaon TrimStats) together with its live sub-processor registry before onboarding European enterprise customers. - Enforce strict PII hygiene in URLs, custom events, and UI friction: Never embed raw emails, names, phone numbers, or session secrets in page query strings, custom event properties, or
identify(userId)calls. Pass opaque internal database UUIDs only, and avoid session-replay libraries that record raw form inputs or full DOM text.


Technical and Organizational Measures (Article 32) to verify in a vendor DPA
Enterprise security reviewers rarely stop at the client script. Under GDPR Article 32, your Data Controller team must verify that the analytics processor enforces defensible server-side isolation, encryption, and deletion workflows. Before signing off on any analytics tool, check these six infrastructure controls directly against the vendor's published DPA:
- Transport encryption across every hop: Confirm both the script endpoint (
t.js) and the ingestion collector (POST /v1/collect) enforce TLS 1.2 or TLS 1.3 exclusively over HTTPS, preventing plaintext referrer or URL interception on shared Wi-Fi networks. - Encryption at rest for sensitive integration secrets: Revenue attribution webhooks require signing secrets from Stripe, Paddle, Polar.sh, or Shopify. TrimStats encrypts stored webhook signing secrets with AES-256-GCM before persisting them in PostgreSQL so a database backup never exposes raw signing keys.
- Strict multi-tenant query scoping: Verify that analytical queries never rely solely on client-side filters. Every ClickHouse query in TrimStats is parameterized and bound server-side to an authenticated organization's owned
site_id. - Private database network isolation: Analytical engines (ClickHouse) and ephemeral session/salt caches (Valkey) should never be exposed on public Internet ports. TrimStats binds ClickHouse and Valkey to private localhost interfaces behind a hardened host firewall in Nuremberg, Germany.
- Defined incident notification window: GDPR Article 33 gives Data Controllers 72 hours to notify supervisory authorities after discovering a personal data breach. Confirm the vendor DPA commits to notifying customers without undue delay and within 72 hours.
- Deterministic revocation and deletion SLAs: Deleting a tracked site should immediately revoke its ingestion key so stranded cached scripts cannot continue writing events, followed by a documented permanent purge window (TrimStats purges deleted site and account data permanently within 30 days).
Auditing sub-processors and controller vs processor boundaries
A frequent audit failure happens when teams list their analytics vendor in their privacy notice but forget to separate visitor telemetry (where the vendor acts as a Data Processor) from customer billing and account logins (where the vendor acts as an independent Data Controller). Mapping both layers clearly speeds up procurement reviews:
| Sub-Processor | Geographic Region | Role in Analytics Stack | Data Scope |
|---|---|---|---|
| Hetzner Online GmbH | Nuremberg, Germany (EU) | Beacon ingestion, ClickHouse analytics storage, Valkey daily salts | Aggregated pageviews, daily salted hashes, active dwell, events (zero raw IPs) |
| Neon Inc. | Frankfurt, Germany (EU) | PostgreSQL relational configuration database | Workspace accounts, site settings, conversion goals, encrypted webhook secrets |
| Vercel Inc. | Global Edge / EU TLS | Next.js web application and dashboard UI delivery | Authenticated dashboard sessions and static marketing pages |
| Polar.sh | Merchant of Record | Subscription billing, VAT/tax invoicing, payment processing | Customer billing details only (never receives site visitor analytics) |
Separating sub-processor duties prevents scope creep during compliance reviews. For example, because Polar.sh operates as TrimStats' Merchant of Record, TrimStats never processes or stores customer payment card numbers, and Polar.sh never touches tracked end-user website telemetry.
Choosing between Cookie-less default and opt-in First-Party ID mode
One size rarely fits every surface inside a modern SaaS business. Public documentation, blog articles, and marketing landing pages usually need accurate daily uniques, campaign UTMs, landing-page engagement, and sign-up conversion totals without interrupting European visitors with consent modals. Product teams running paid acquisition or 30-day self-serve free trials, however, sometimes want multi-week retention cohorts and 90-day multi-touch revenue attribution tied to server-verified Stripe or Paddle payments.
Using a single dual-mode architecture solves that tension cleanly without installing two competing scripts:
- Run public marketing, blog, and docs in default Cookie-less mode: Keep zero client storage across anonymous acquisition pages so visitors read your content with zero banners and zero browser-storage writes. Note that national authorities such as France's CNIL publish specific audience-measurement exemption criteria (strictly first-party purpose, no cross-site tracking, aggregate reporting, capped retention); pairing default zero-storage mode with EU hosting puts your public site on the cleanest technical footing possible.
- Gate
data-mode="first-party"behind explicit consent or authenticated app surfaces: Only activate First-Party ID mode (_ts_vidand_ts_attrin origin-scopedlocalStorage) when your legal counsel confirms either valid user consent under ePrivacy Article 5(3) or strictly scoped authenticated product analytics covered by your customer agreement. - Never silently fall back to cookies: If a visitor declines analytics storage or runs a strict browser privacy extension that blocks
localStorage, TrimStats degrades automatically to daily salted cookie-less counting instead of attempting fingerprinting workarounds.
Records of Processing Activities (RoPA) summary for your privacy team
Under GDPR Article 30, organizations must document each processing activity in an internal Record of Processing Activities (RoPA). Below is a compact engineering handoff template you can adapt with your legal counsel or Data Protection Officer when adopting EU-hosted cookie-less analytics:
| RoPA Field | Typical Entry for TrimStats Cookie-less Mode |
|---|---|
| Processing Purpose | Aggregate website traffic measurement, performance diagnostics, and product conversion reporting |
| Categories of Data | URL path, HTTP referrer domain, UTM parameters, country code, browser/OS/device family, active foreground dwell time, optional CSS friction selectors |
| Terminal Storage (ePrivacy) | None (0 cookies, 0 localStorage keys in default mode) |
| IP Address Handling | Transient in-memory processing only for country lookup and 24-hour rotating SHA-256 salt; never persisted to disk |
| Retention Schedule | Automatic plan-bounded expiration (90, 365, 730, or 1,095 days depending on workspace tier) |
| International Transfers | Analytics storage and relational metadata hosted in Germany (Nuremberg & Frankfurt, EEA) |
| Deletion & Revocation | Immediate tracking key revocation on site deletion; permanent purge within 30 days |
Practical PII traps developers miss during implementation
Even teams using strictly cookie-less EU analytics can accidentally leak personal data through application-level URLs or event calls. Audit these four hotspots before launch:
| Hotspot | Risky Pattern to Avoid | Privacy-Safe Replacement |
|---|---|---|
| Password reset & invite URLs | /invite?email=jane@acme.com | /invite/opaque_token_hash (excluded from public indexing) |
Logged-in identify() calls | trimstats('identify', user.email) | trimstats('identify', user.uuid) (opaque 128-char max ID) |
| Custom event properties | { user_name: 'Jane', ip: '...' } | { plan: 'growth', billing: 'annual' } |
| UX / click debugging | Full DOM video session replay | Compact CSS selector hints (button#apply-coupon.btn-ghost) with zero text capture |
TrimStats UI friction tracking (data-friction="true") follows this data-minimization principle strictly: it watches only 8 structural DOM attributes (class, style, hidden, open, aria-expanded, aria-selected, aria-pressed, data-state) for 500 ms and never reads innerText or input values.
Comparing the cost of EU-hosted privacy analytics
Privacy-first EU hosting no longer carries an enterprise price premium. Comparing verified November 2026 pricing across major EU-ready analytics platforms shows predictable scaling from small content sites to 5M-event SaaS properties:
Monthly cost of EU-hosted privacy analytics at 100k, 1M, and 5M events
Verified monthly USD pricing comparing TrimStats, Fathom, and Plausible Business (Nov 2026)
Switching off cookie-based ad-tech analytics onto EU-hosted infrastructure costs $17 to $134/month on TrimStats with funnels and revenue webhooks included.
Methodology: Monthly USD billing verified on 2026-11-30 from TrimStats CANONICAL_FACTS, usefathom.com/pricing, and plausible.io/#pricing (Business shown for funnels/revenue parity).
View chart data table
| Label | TrimStats (Germany EU) | Fathom (EU Isolation) | Plausible Business (EU) |
|---|---|---|---|
| 100k events | $17/mo | $15/mo | $39/mo |
| 1M events | $44/mo | $60/mo | $139/mo |
| 5M events | $134/mo | $140/mo | $259/mo |
Pre-launch DevTools verification workflow
Run this 60-second verification against your staging or production URL before closing your GDPR readiness ticket:
- Open an Incognito browser window and navigate to your homepage with DevTools open.
- Under Application -> Storage, confirm zero cookies and zero
localStoragekeys were created byt.js. - Under Network, inspect
t.js(200 OK,1,964 Bgzipped) andPOST /v1/collect(202 Accepted,Content-Type: text/plain). - Inspect the JSON body of
POST /v1/collectand confirm zero email addresses, form values, or persistentvidfields appear in default cookie-less mode. - Add TrimStats (and its Nuremberg/Frankfurt Germany sub-processors) to your public Privacy Policy and sub-processor registry.
Want to dive deeper into the cryptographic hashing math behind item 6? Read How Cookie-less Web Analytics Works or explore TrimStats Dual-Mode Privacy Analytics.
Frequently asked questions
Can any analytics vendor promise automatic GDPR compliance for my whole website?
What is the difference between GDPR and the EU ePrivacy Directive for analytics?
Does TrimStats provide a GDPR Article 28 Data Processing Agreement (DPA)?
What happens if I opt in to First-Party ID mode on a European site?
Should I strip sensitive query parameters before sending analytics beacons?
How can engineers verify in Chrome DevTools that an analytics script sets zero cookies?
Why does EU data residency in Germany matter for GDPR analytics transfers?
Sources & references
- EUR-Lex: General Data Protection Regulation (EU) 2016/679Accessed 2026-11-30
- EUR-Lex: ePrivacy Directive 2002/58/EC (Article 5(3))Accessed 2026-11-30
- CNIL Guidance on Exempt Audience Measurement ToolsAccessed 2026-11-30
- TrimStats Privacy Policy & Data Processing AgreementAccessed 2026-11-30
Co-founder and Product Manager at DotCamp LLC and co-creator of TrimStats. Publisher, SEO practitioner, and WordPress product leader building creator tools since 2012.
- • Co-founder & Product Manager at DotCamp LLC (est. 2019), guiding product strategy for Ultimate Blocks, WP Table Builder, OptimizeCamp, and TrimStats
- • Full-time publisher and digital marketer since 2012; founder of RoadToBlogging.com and WPLeaders.com
- • WordPress.org Plugin Developer, Support Contributor, and WordCamp Sylhet 2023 speaker on building WordPress products
Verification standard: Systems architecture: Mapped directly against TrimStats production collector controls, EU sub-processor residency (Hetzner Nuremberg + Neon Frankfurt), and DevTools verification steps.
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.