Skip to content
Faisal Mahmud TusherDigital marketing, SEO & analytics
with Faisal Tusher

Marketing Analytics › Measurement Planning

Keeping Personal Data Out of Analytics

Where personal data leaks into analytics through URLs, form fields, search terms and identifiers, how to find it, stop it at the source and handle what got in.
Guideintermediate12 min readUpdated

What counts as personal data in analytics

The GDPR defines personal data broadly: any information relating to an identified or identifiable person, including names, identification numbers, location data and online identifiers. It also sets out principles that apply to every system holding such data, and two of them matter most here. Data minimisation means collecting only what is adequate, relevant and limited to what the purpose needs. Storage limitation means keeping data in a form that identifies people for no longer than the purpose needs. An analytics property that quietly accumulates email addresses fails both, because no report ever needed them.

Analytics data falls into two groups, and the distinction drives everything below.

GroupExamplesHow to treat it
Data that names or directly reaches a personEmail address, name, phone number, postal address, a login name, free text a person typedKeep it out of analytics entirely; Google's terms forbid sending it, as the events and parameters guide states
Pseudonymous identifiersThe cookie-based client identifier, an internal customer number used as a User-ID, a session identifierThe basis of measurement; still personal data under the GDPR, so collected under the consent and lawful basis the plan records
Details that reveal something sensitivePage paths or parameters that reveal a health condition, a financial difficulty or similarThe GDPR gives some categories, health among them, special protection; combined with any identifier, such details deserve a deliberate decision rather than a default

The guide's subject is the first group, and making sure the second group never turns into it. A first-party customer record is valuable in the CRM, where access, purpose and retention are managed; the same email address in an analytics dimension is visible to everyone with report access, copied into every export and kept for as long as the property and the export hold it. How long each marketing tool, including the warehouse that receives the export, keeps the personal data it does need is covered in the guide to data retention across marketing tools.

How personal data gets in

Almost every leak is one of a short list of routes. Each has a recognisable signature in the data.

RouteHow it happensWhere it shows
Forms that submit in the address barA form sends its fields as query parameters, so the next page's address carries themPage location and page path with query strings
Identifiers in confirmation and account addressesBooking confirmations, unsubscribe links, password resets and account pages built with an email or name in the addressPage location; referrer of the next page
Site searchPeople type email addresses, names, phone numbers and order references into the search boxThe search term parameter
Triggers that read the pageA variable reads a form field's value, a greeting such as "Welcome back, Jane", or text from an order summaryCustom event parameters
Page titlesAccount and order pages whose titles include the customer's namePage title
CRM fields sent as attributesA user property or Custom Dimension filled from the customer recordUser properties and custom dimensions
Campaign tags filled by other toolsAn email platform's merge field puts the subscriber's address into a campaign parameterCampaign dimensions such as content and term
An over-full data layerThe purchase object carries the customer's email for a tag that needs it, and other tags read it tooAny tag configured to forward the whole object

Two of these deserve a closer look. The data layer route is subtle because the data layer is supposed to hold rich information; Google's documentation describes it as the object that passes information to tags, and the data layer guide explains the merging behaviour that lets a value pushed for one purpose linger for the next tag that reads the same key. Where a tag genuinely needs customer data, as the enhanced conversions guide describes for one advertising feature, the push and the variables that read it have to be scoped so that the analytics tag never sees them. The campaign tag route is subtle because nobody on the analytics side wrote it: the person building an email template added a merge field to make links "personal", and every click now carries an address into campaign reports. Research tools beside analytics raise the same question: session recordings can capture what people type into forms, which is why the tutorial on reviewing session recordings and heatmaps masks every input before a single recording is collected.

Where it spreads once collected

Fixing a route stops new data. It does nothing about the copies already made, and in a modern measurement stack there are several.

  • The property itself. Standard reports, explorations, saved comparisons and any audience whose conditions read the affected dimension.
  • The BigQuery export. Every parameter arrives in the raw event tables whether or not it was registered, and, as the BigQuery export basics guide notes, those tables stay for as long as you keep them.
  • Summary tables and dashboards. Scheduled queries that aggregated page locations or search terms, dashboards connected to the property or the export, extracts and cached results, scheduled PDF deliveries.
  • Downloads. Spreadsheets exported for a meeting months ago, attachments in email threads, slides with a screenshot of a search terms table.

Write this list down for your own stack before the first incident, with an owner for each place. When a leak is found, the list becomes the clean-up plan.

Finding it: a sweep of reports and the export

A sweep is a search for the signatures of personal data across every place a free-text value can land. Run it once now, after every release that touches forms, search or account pages, and on a schedule alongside the data quality routine.

  1. List the free-text fields. Page location, page path and query string, page title, page referrer, the search term, every registered custom dimension and user property, and the campaign dimensions.
  2. Define the patterns. An at sign followed by a domain for email addresses; long runs of digits for phone and card numbers; query keys such as email, name, phone, address and postcode; greeting words in titles; the formats of your own account and order references.
  3. Search the interface. In an exploration, add each free-text dimension with a filter that matches the patterns, over the longest period event data allows; the retention step of the GA4 setup tutorial decides how far back that is.
  4. Search the export. Query the string values of every parameter and user property for the same patterns; the export holds parameters that were never registered and so never appear in the interface.
  5. Record counts and locations, not values. Note which field, which page template or campaign, from when and how many events. Never paste the found data into a ticket, a chat or a spreadsheet, which only creates another copy.

The audit in the analytics implementation scorecard checks tags, consent and events; adding the sweep to it turns a one-off search into part of the regular review.

Stopping it at the source

The rule is to fix the page or the data layer first and to use the container only as a safety net. A container can redact what it receives, but it only sees what the page gives it, and a redaction pattern written for today's formats will miss tomorrow's.

RouteFix at the sourceSafety net in the container
Forms in the address barSubmit forms in the request body, not the address; never place field values in a redirectStrip listed query keys from the page location before it is sent
Confirmation and account addressesUse an opaque reference in the address and look the customer up on the serverThe same cleaned page location
Site searchKeep the feature; agree a redaction rule for patterns before the term is sentA variable that replaces matching patterns with a placeholder
Triggers that read the pagePush only the form name, type and outcome to the data layer; never the valuesRemove any variable that reads input fields or greeting text
Page titlesGive account and order templates titles without namesSend a template name as the title for those templates
CRM fields as attributesSend categories, such as customer tier, not identifiersReview every user property against the tracking plan
Campaign tags from other toolsBan personal merge fields in campaign parameters in the naming conventionTreat campaign values that match the patterns as a release blocker
Over-full data layerScope customer data to the push and tag that need itKeep customer fields out of any object a tag forwards wholesale, such as the e-commerce object

The cleaned page location is worth a sentence of detail because it covers several routes at once. The container builds the address without the listed query keys in a variable, and the analytics tag sends that variable as the page location; the GA4 through GTM tutorial shows the same field being set explicitly for single-page applications. Keep the list of stripped keys in the tracking plan, next to a rule that no parameter may carry personal data, so that developers see the constraint where they read the specification.

Pseudonymous identifiers and hashing

Analytics needs identifiers to count users and stitch sessions, and they are legitimate when collected under the consent and lawful basis the measurement plan records. They are also personal data: the GDPR treats pseudonymised data, which can be linked to a person with additional information, as personal data still. Two practical rules follow.

First, a User-ID should be an internal identifier that only your systems can resolve: a customer number, not an email address, a phone number or a name. Second, do not build that identifier by encoding or hashing an email address. A hash of an address comes out the same for anyone who applies the same method to it, so any party holding the address can match it; it has changed the format of the identifier, not its nature. Where Google documents sending hashed customer data, as with enhanced conversions, it is for a specific advertising feature, and the analytics pages cited here describe no such use for parameters, so a hashed email in an analytics dimension should be found and removed like any other. The routine for minimising data before prompting applies the same reasoning to customer data sent to AI tools, including where to keep the key when you pseudonymise.

When personal data has already been collected

A sweep that finds something starts a short, ordered response.

  1. Stop the source. Ship the fix, then confirm with the sweep that new events are clean.
  2. Record the incident. Field, route, first and last date, number of events, the release that caused it and the one that fixed it.
  3. Tell the person who owns privacy. Whether anything must be reported, and to whom, is their decision with legal advice; this guide does not make it.
  4. Clean the places you control. Rewrite or delete the affected rows in the export and in every summary table built from it, refresh dashboards, extracts and caches, and ask people who downloaded affected reports to delete their copies.
  5. Check the platform's own options for the property. Read the Analytics help centre for the current ways to remove collected data before choosing one, because what can be removed, and at what granularity, is the platform's to define rather than this guide's.
  6. Sweep again after a week to confirm nothing new has arrived by a route you missed.
Illustrative example — not a real result

Quernlight Physiotherapy sweeps its property

Quernlight Physiotherapy is an invented group of six clinics with an online booking form. A new analyst runs the sweep over the 61 days of data the team can check and finds three routes. The booking form submits in the address bar, so 1,284 page view events carry an email address and phone number in the confirmation page's location. The site search box holds 212 terms that match the patterns, mostly patients typing their own email address or a physiotherapist's full name. And the account page title, "Bookings for" followed by the patient's name, appears on 38 events. The export query that finds the first and second routes looks like this:

SELECT event_date, event_name, p.key, COUNT(*) AS events
FROM `quernlight-analytics.analytics_481516.events_*`, UNNEST(event_params) AS p
WHERE _TABLE_SUFFIX BETWEEN '20261001' AND '20261130'
  AND REGEXP_CONTAINS(p.value.string_value, r'[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}')
GROUP BY event_date, event_name, p.key
ORDER BY events DESC;

The fixes ship in one release: the form posts its fields and the confirmation page shows a booking reference, the container strips the email and phone keys from the page location and replaces pattern matches in search terms with a placeholder, and the account template's title becomes "My bookings". The analyst records the incident with counts and dates, the practice manager who owns privacy reviews it, and the affected partitions in the export and two summary tables are rewritten without the values. A sweep a week later finds three search terms that slipped through because patients typed spaces inside their phone numbers; the redaction pattern is widened, and the following sweep returns nothing.

A sweep finds the most when it runs on a rhythm rather than after an incident; the privacy and consent operations playbook schedules it beside the monthly suppression check and the quarterly retention runs, with named owners for each.

Common mistakes

  • Fixing the tag and forgetting the copies. The export, summary tables, dashboards and downloads still hold what the property received before the fix.
  • Relying on container redaction alone. The page keeps producing the data; the container misses the first format nobody anticipated.
  • Turning off site search tracking instead of redacting it. The search log is one of the most useful reports a site has, and the problem was a handful of patterns.
  • Personal merge fields in campaign links. The email team's personalisation becomes the analytics team's leak; the naming convention has to forbid it.
  • Calling a hashed email anonymous. It still identifies the person to anyone holding the address.
  • Pasting examples into tickets. Recording the values to prove the problem makes another copy of it.
  • Treating consent as permission. A visitor who accepted analytics cookies did not agree to have their email address stored in a report, and the tool's terms forbid it either way.
  • Sweeping once. Every release that touches forms, search, accounts or email templates can open a new route; the sweep belongs in the routine.

The measurement planning hub places this check beside the other parts of the plan, and the privacy and consent guide covers what tags may observe once a visitor has made a choice.

Frequently asked questions

Is it a problem if an email address appears in Google Analytics once or twice?

Yes, and the count matters less than the route. A single address in a report usually means a page, form or link is built in a way that will keep sending addresses until it is changed, so treat the first sighting as a defect with a cause. Stop the source, record what was found and where, tell whoever owns privacy in the business, and clean the places you control. Google's analytics terms forbid sending information that identifies a person, which is why the fix belongs in the site and the data layer rather than in a report filter that only hides it.

Can I send a hashed email address as the User-ID or as an event parameter?

Treat a hashed email as the email it came from. Anyone who holds the address can compute the same hash and match it, so it still points to one person, and the GDPR treats pseudonymised data as personal data. A User-ID should be an internal identifier that only your own systems can resolve, set under the same consent rules as the rest of measurement. Where Google documents sending hashed customer data, as with enhanced conversions in the Google Ads section, it is for a specific advertising feature; the analytics pages this site relies on describe no such use for event parameters.

Does a consent banner make it acceptable to collect personal data in analytics?

No. Consent decides whether tags may set identifiers and record a visitor's behaviour at all; it does not change what the analytics tool's terms allow you to send, and it does not make an email address in a URL a sensible thing to store in a reporting system that dozens of people can open. Consent and minimisation are separate controls. The privacy and consent guide covers the first; this guide covers the second, which applies even to visitors who agreed to everything.

Terms used on this page

Frameworks

Where this page is used

Sources

  1. Regulation (EU) 2016/679 (GDPR) — EUR-Lex
  2. [GA4] About events — Google Analytics Help
  3. The data layer — Google Tag Platform
  4. Google Analytics Help — Google Analytics Help

Related