← All articles

Privacy · 10 min read · 2026-10-27

PII in Your Event Stream: The Audit Most SaaS Fail

No one decides to send a customer's email address to their analytics tool. It arrives anyway — in the query string of a form that used GET instead of POST, in a free-text event property that captured whatever a user typed, in a referrer from an authenticated page, or inside an identify call that copied the whole user object from your auth system. Each of these passes code review looking completely innocent, which is why personally identifiable information ends up in the event stream of the large majority of SaaS analytics setups, and why almost nobody has audited for it. The leak sits there creating GDPR and erasure exposure, and quietly wrecking the cardinality of the dimensions you report on.

This is a source-side audit playbook: how to find the PII that is already in your pipeline, how to stop it at the point of collection so it never reaches any tool, and why the vendor redaction features you may be relying on are a net, not a fix. It pairs with the policy-level view in the data minimization and liability guide — that post covers the why and the legal exposure; this one is the hands-on how.

The four places PII leaks in

PII does not spread evenly through an event stream — it clusters in four predictable channels, and knowing them turns a vague worry into a checklist. The first and most common is the URL. A form submitted with the GET method appends every field to the query string, so an email, a name, or a search term lands directly in page_location and, on the next page, in page_referrer. Confirmation, password-reset, and email-verify pages carry tokens or the email itself in the path for the same reason. Any tool that records the URL — which is all of them — captures it verbatim.

The second channel is free-text event properties. A developer wires up a search_performed event and passes the raw query, or a ticket_created event and passes the subject line, without considering that users type names, emails, and account numbers into those boxes. The third is referrers from authenticated third-party surfaces that embed a user id. The fourth, and the most dangerous because it is deliberate code, is the identify or trait call that copies your whole user object — stable id plus email, full name, and phone — when all you needed was the id. The same discipline that keeps a tracking plan and event schema honest is what prevents channel four: decide each property's type and allowed values before you send it.

Why this is a data-quality problem, not just a legal one

Treating PII leakage purely as a compliance issue undersells it, because the same leak degrades the reports you built the tracking for. PII is almost always high-cardinality: a property that should hold a handful of enum values instead holds thousands of unique, email-laden strings. That inflates storage, and more importantly it blows past the cardinality ceilings where analytics tools stop tracking individual values and dump everything into a catch-all bucket — the same mechanism described in the high-cardinality "other" row guide. A dimension that has collapsed into an "other" row is useless for grouping, so the leak silently costs you the ability to segment by that field.

A referrer field full of session tokens does the same thing to your acquisition reporting: what should be a clean breakdown of a dozen channels fragments into a long tail of one-hit URLs that no one can read. So every PII leak is really two problems stacked — legal exposure on one side, degraded analytics on the other. That is the useful reframe for getting engineering time to fix it: this is not only a privacy chore, it is a fix for the dimensions your growth team already complains are noisy. It belongs in the same cadence as your data-quality audit checklist.

The audit: query your own event stream

Do not guess where the PII is — query for it. Pull a sample of recent events from your warehouse, your tool's export, or a raw event log, and run three passes over every string property and URL field. Pass one is an email regex ([^@\s]+@[^@\s]+\.[a-z]+) across all properties, page paths, and referrers. Pass two looks for long digit runs that could be phone numbers, national IDs, or raw user ids. Pass three greps your own known leaky parameter keys — email, token, reset, name, phone — in query strings. These three passes catch most of what matters because leaks concentrate in exactly these forms.

Then sort every string property by its distinct-value count. Anything meant to be an enum — a method, a plan name, a boolean-ish flag — that shows thousands of unique values is a leak suspect, and the distinct-count sort surfaces them without you having to know in advance which property broke. Finish with a manual pass: open your highest-traffic forms, your confirmation and reset pages, and your in-app search in a browser, and watch what lands in page_location as you use them. Twenty focused minutes of querying plus a short manual walk finds the large majority of leaks in a typical setup.

Stop it at the source, not at the vendor

The durable fix is to prevent PII from ever being collected, which means changing the source rather than configuring each tool's filter. Switch every form that handles sensitive input from GET to POST, so field values stop appearing in the URL. Strip identifiers out of confirmation and reset URLs, or move the token into a short-lived server-side session instead of the path. In your tag manager or a client-side middleware, redact known-bad query parameters and scrub free-text property values before any tag fires, so the scrub happens once, upstream of every destination.

The case for source-side over vendor-side is simple: a vendor filter only protects that one vendor, and only for the patterns it happens to match. Google is explicit that GA4's data redaction is best-effort and does not discharge your obligation to keep PII out by other means, and it does nothing for your warehouse, product-analytics SDK, or session-replay tool. A vendor guide makes the corollary concrete: ensure website forms use POST instead of GET, because GET appends form data straight to the URL. Fix the source once and every downstream tool is clean; configure filters per vendor and you are maintaining the same patch in five places and still missing the sixth.

Remediate the history and keep it clean

Fixing the source stops new leaks but does nothing about the contaminated events already sitting in your warehouse — and known PII at rest is live exposure, squarely in scope of any data-subject erasure request. Address it in order of preference: re-process the affected tables to null or hash the offending columns in place; drop the leaked properties entirely if they were never analytically useful; or, where contamination is pervasive and the data is old, delete the affected partitions. Whichever path you take, remediate the source first so you are not re-cleaning the same leak next week, and keep a record of what you changed and when. The mechanics of honoring deletion requests across analytics stores are covered in the right-to-erasure and retention audit guide.

To keep it clean, make the audit recurring and cheap. Add the three regex passes as a scheduled check against a sample of each day's events, and alert when a property's distinct-value count jumps or an email pattern appears where it should not. Wire a lightweight version into your tracking tests so a new GET form or a copied user object fails CI before it ships — the same shift-left approach described in the tracking regression-testing guide. PII leakage is not a one-time cleanup; it is a class of regression that reappears every time someone adds a form or an event, so the only real fix is a guard that runs on every change.

FAQ

How does PII end up in analytics events by accident?

Almost never on purpose — it arrives through four quiet channels. The first is URLs: a form submitted with the GET method appends field values to the query string, so an email or name lands in page_location and page_referrer verbatim; confirmation and password-reset pages often carry an email or token in the path for the same reason. The second is free-text event properties, where a developer passes a raw search query, a support-ticket subject, or a profile field as a property value without thinking about what users type into it. The third is referrers from authenticated third-party pages that embed a user identifier. The fourth is user-id or trait objects copied wholesale from your auth system into the analytics identify call, dragging email, full name, and phone along with the stable id you actually wanted. None of these look like a mistake in code review, which is why the leak is so common.

Doesn't GA4 data redaction already remove PII for me?

Only partially, and only for one tool. GA4's data redaction scans event parameters and URL query parameters for text that looks like an email address and strips it on a best-effort basis, and it lets you list specific query-parameter keys to remove. But Google is explicit that the feature does not discharge your responsibility: it will not catch names, phone numbers, national IDs, or an email that was split across two fields, and it does nothing for the data you send to every other tool in your stack — your warehouse, your product analytics SDK, your session-replay vendor. Redaction is a safety net on the collection edge of one vendor, not an audit. The durable fix is to stop the PII at the source — change GET forms to POST, strip identifiers before the tag fires — so no tool ever receives it, rather than hoping each vendor's best-effort filter catches it.

Why does PII in event properties hurt data quality, not just compliance?

Because PII is almost always high-cardinality, and high-cardinality values poison the dimensions they land in. A property that should hold a handful of enum values — say, signup_method — instead holds thousands of unique email-laden strings, which inflates storage, blows past the cardinality limits where tools bucket everything into an 'other' row, and makes the dimension useless for grouping. A referrer field full of session tokens fragments what should be a clean channel breakdown into a long tail of one-hit URLs. So the leak costs you twice: it creates GDPR and erasure exposure on the legal side, and it quietly degrades the exact reports you built the tracking for. Fixing it improves both your compliance posture and your data.

What is the fastest way to audit an existing analytics setup for PII?

Query, don't guess. Pull a sample of recent events from your warehouse or export and run three regex passes over every string property and URL field: one for email patterns (something@something.tld), one for long numeric strings that could be phone numbers or IDs, and one for your own known query-parameter keys like email, token, reset, and name. Sort properties by distinct-value count — anything meant to be an enum that shows thousands of unique values is a leak suspect. Then open your highest-traffic forms and confirmation pages in the browser and watch what lands in page_location. Twenty minutes of this finds the large majority of leaks, because they cluster in a few predictable places rather than spreading evenly.

Should I delete historical events that already contain PII?

You have to address them — leaving known PII in a warehouse is live exposure under GDPR and most US state laws, and it is squarely within scope of a data-subject erasure request. The options, roughly in order of preference, are: re-process the affected tables to null or hash the offending columns in place; drop the specific properties entirely if they were never analytically useful; or, if the contamination is pervasive and the data is old, delete the partitions. Whichever you choose, fix the source first so you are not re-cleaning the same leak next week, then document what you remediated and when, because an auditor or a regulator will ask you to show the before and after.