← All guides

Privacy & compliance

GDPR and Web Analytics: A Practical Privacy-First Guide

Understand GDPR requirements for web analytics, cookies, consent, data minimisation, retention, vendors, and privacy notices—with an actionable checklist.

By TrailPixel editorial teamReviewed by TrailPixel privacy teamUpdated 2026-08-2518 min read

GDPR-ready analytics is not a checkbox or a product label. It is a documented system: a specific purpose, an appropriate legal basis, the minimum data needed for that purpose, clear information for visitors, controlled retention, and evidence that those decisions are followed in practice.

This guide translates the GDPR principles into an analytics workflow for product, marketing, and engineering teams. It is educational information, not legal advice; requirements vary with your technology, purpose, users, and national ePrivacy rules.

The short answer

For every analytics field and identifier, be able to answer: Why do we need it? What is our legal basis? Where does it go? Who can access it? How long is it kept? How can a person exercise their rights? If one answer is missing, the setup is not ready for production.

  • Map the exact data flow—not just the vendor name
  • Separate device-storage rules from the GDPR legal basis for later processing
  • Collect only fields tied to a documented decision
  • Give visitors concise, specific information
  • Set and enforce deletion or review dates
  • Keep contracts, settings, tests, and decisions as accountability evidence

1. Decide whether analytics processes personal data

Online identifiers, cookie IDs, full IP addresses, user IDs, and combinations of device or behavioural data may relate to an identifiable person. Pseudonymised data remains personal data when it can be attributed using additional information. Truly anonymous aggregate data falls outside the GDPR, but anonymisation is a demanding standard—not a marketing synonym for hashing.

Review the complete path from browser to report. URLs can leak names, email addresses, order numbers, search terms, or reset tokens. Referrers, custom properties, support recordings, and data exports deserve the same review as the core event payload.

Data elementTypical riskLower-data alternative
Full IP addressLocation or online identifierAvoid storage; aggregate coarse geography when justified
Persistent visitor IDCross-session linkabilityShort-lived session or aggregate counts
Full page URLPersonal data in query stringsAllowlisted path with query values removed
Free-form event valueAccidental names, emails, or secretsEnumerated, validated properties
Exact timestampLinkability with other logsReduced precision where the use case allows

2. Apply the seven GDPR principles

The European Commission summarises seven principles: lawfulness, fairness and transparency; purpose limitation; data minimisation; accuracy; storage limitation; integrity and confidentiality; and accountability. Turn each one into a testable analytics control.

PrincipleAnalytics control
Lawfulness and transparencyRecord the legal basis and explain collection in plain language
Purpose limitationTie every event to a named measurement purpose
Data minimisationDefault-deny fields; allowlist only what is necessary
AccuracyDocument known gaps, bots, and attribution limits
Storage limitationAutomate deletion and review aggregates separately
Integrity and confidentialityEncrypt in transit, restrict access, audit exports
AccountabilityKeep a processing record, decisions, contracts, and QA evidence

5. Write an analytics privacy notice people can use

Articles 12–14 require information to be concise, transparent, intelligible, accessible, and in clear language. Place a short just-in-time explanation near the choice and link to a fuller notice. Keep the notice aligned with the actual network requests and product settings.

  • Controller identity and contact details
  • Specific purposes and legal basis
  • Categories of data and how identifiers work
  • Recipients, processors, and relevant international transfers
  • Retention period or the criteria used to set it
  • Rights, withdrawal, objection, and supervisory-authority complaint
  • Whether data is required and the consequence of not providing it
  • Relevant automated decision-making information

6. Govern analytics vendors and processors

When a vendor processes personal data on your behalf, assess its role and put Article 28 terms in place. Check instructions, confidentiality, security, subprocessor controls, assistance with rights and incidents, deletion or return, and audit information. If data leaves the EEA, document the transfer mechanism and supplementary measures where required.

  • Record hosting regions and every subprocessor
  • Restrict vendor use of customer data to documented instructions
  • Review admin access and export permissions
  • Test deletion at account, site, and event level
  • Create an incident contact and escalation path
  • Reassess material product or subprocessor changes

7. Set retention from the purpose—not a round number

The Commission explains that personal data should be kept for the shortest time possible, with time limits to erase or review it. Separate raw event retention from longer-lived anonymous aggregates. A useful schedule names the data class, purpose, duration, deletion method, owner, and exception.

Data classQuestion to answerControl
Raw eventsHow long are row-level journeys needed?Automatic rolling deletion
IdentifiersWhen does cross-session value expire?Short lifetime and rotation
AggregatesCan they identify anyone?Anonymisation assessment
BackupsWhen do deleted records age out?Documented backup lifecycle
ExportsWho owns copies outside the platform?Expiry and access review

8. GDPR analytics launch checklist

  • Inventory scripts, pixels, SDKs, cookies, local storage, and server events
  • Capture and inspect real payloads on every important journey
  • Strip query values and block sensitive routes by default
  • Create a field-level purpose and retention map
  • Complete the legal-basis and ePrivacy assessment
  • Sign processor terms and review transfers and subprocessors
  • Update the privacy notice and consent interface
  • Test accept, reject, ignore, withdraw, and expired-choice states
  • Restrict access and enable deletion procedures
  • Schedule quarterly and post-release reviews

Frequently asked questions

Does cookieless analytics guarantee GDPR compliance? No. Cookies are only one possible technology. Identifiers, IP handling, event content, purpose, legal basis, transparency, retention, security, and vendor relationships still matter.

Can analytics run without consent? The answer depends on device access, whether personal data is processed, the purpose, safeguards, national ePrivacy implementation, and available exemptions. Do not treat a vendor claim as a jurisdiction-specific legal conclusion.

Is hashing an email anonymous? Usually not by itself. If a value can still be singled out, matched, or attributed with other information, it is generally pseudonymised rather than anonymous.

Who is responsible: the site or the analytics vendor? Roles depend on the facts, but a site choosing purposes and means will commonly have controller responsibilities; a service provider may be a processor for some activities and have separate roles for others.

Primary sources

Evidence behind this guide

Last reviewed 2026-08-25. This guide is general educational information and is not legal advice.

Put the guide into practice

TrailPixel combines cookieless tracking, automatic funnel detection, and A/B testing in one workflow.

Start free

Continue reading