← Guides·Data Privacy

Data Privacy

PII detection in analytics: find personal data in your tags

PII detection for analytics and ad tags: where personal data leaks, five ways to find it, and how Trackingplan flags it on real traffic, field by field.

David PombarSwiss army knife at Trackingplan
11 min read · 2438 words

A PII leak in analytics is personal data that leaves your site, app, or server inside a tracking request: an email in a page URL sent to GA4, a name in a dataLayer push forwarded to Meta, a user token in a custom dimension. Nobody decides to send it. A form, a release, or a tag configuration does it for you, on every visit, until someone notices.

PII detection in analytics is the practice of finding those requests. Look at what your tags actually send, not at what your policy says they send. This guide covers where leaks come from, the five ways to detect them and what each one proves, what a useful finding contains, and how Trackingplan does it on your real traffic.

What counts as a PII leak in analytics

A PII leak is any personal identifier that reaches a vendor in a tracking payload when it should not. The vendor can be an analytics tool, an ad platform, a CRM, or your own warehouse. The payload can be a URL, an event parameter, a user property, a cookie value, or a server-side request.

Google is explicit about its own tools. Its policy prohibits sending Google Analytics any data it could use or recognize as a personal identifier, and its best practices to avoid sending PII list where that data usually hides: page URLs and titles, search boxes and form fields, campaign parameters, site search terms, event labels, user IDs, custom dimensions, and precise location.

Under GDPR and similar laws, the question is wider than one vendor’s terms. Personal data sent to a third party without a legal basis is a transfer you have to justify, whether it was intended or not.

Where PII leaks come from

Most leaks are side effects of normal work, which is why a one-off audit rarely finds them all:

How Trackingplan detects PII leaks on real traffic

Trackingplan inspects every hit for PII leaks, Consent Mode misfires, and vendors firing without permission, across web, mobile, and server-side. It does not run a test of your site. It watches the requests your real visitors already send.

The mechanism has three parts.

1. It observes what already leaves. The Trackingplan SDK runs in your users’ browsers and apps and observes only the requests already being sent to the third-party services you chose: Google Analytics, Google Ads, Meta, HubSpot, Mixpanel, and the rest. Server-side, it reads the hits your server container forwards. It installs with one tag, SDK, or server-side hook, and there is no schema to define and no rules to write.

2. It classifies the data, on the device. Trackingplan identifies private data with a broad range of patterns and vendor-specific rules; a field can be classified by its name, as in the example below. Private fields are masked on the device by default, so personal data never leaves the user’s browser on its way to Trackingplan. It masks instead of hashing, to avoid identifying users across requests, and you can extend the PII rules for your own case. Details are in the privacy and security docs.

3. It reports by sensitivity, vendor, and field. The Privacy Report organizes what it finds in three tiers, and marks each data element green when nothing was sent and with a warning when something was.

Trackingplan’s Privacy Report: highly sensitive, sensitive, and general personal information, with three issues flagged on Google Analytics 4.
Trackingplan’s Privacy Report: highly sensitive, sensitive, and general personal information, with three issues flagged on Google Analytics 4.

The three sensitivity tiers

What it covers

What a PII finding looks like

An alert that only says “email detected” creates work. A Trackingplan finding is meant to be fixed, not investigated. For each issue, the Privacy Report shows:

A Privacy Report issue list: a hashed email sent to Google Analytics 4 as im_user_email_sha256 and classified as a token, with the provider, the occurrence graph, and the explanation.
A Privacy Report issue list: a hashed email sent to Google Analytics 4 as im_user_email_sha256 and classified as a token, with the provider, the occurrence graph, and the explanation.

From there you can open the hits in the data explorer, or mute an issue you decide is not a risk. Findings land in your privacy channel with the hits, the vendor, the market, and the regulation involved. To find what sent it, click Analyze on the issue: the agent narrows it down in the hits and looks for the tag, trigger, and variable that send the field, and what changed in your GTM container around the time it started. The goal is that the fix is a tag change, not an investigation.

Five ways to detect PII leaks

MethodWhat it seesWhen it finds a problemMain blind spotBest use
Browser and network inspectionRequests, URLs, headers, payloads, initiators, and the dataLayer in one sessionDuring the investigationOnly the pages, states, and devices you testGround truth for one incident
Vendor diagnosticsOne vendor’s tags, consent signals, and collection rulesDuring setup or targeted debuggingScoped to that vendorPlatform-specific behavior
Synthetic audits and journeysDefined pages and journeys, across regions and consent statesOn a schedule or before a releaseOnly the paths, credentials, and states configuredRepeatable regression tests
Payload pattern detectionValues that look like emails, phones, IDs, card numbers, or custom patternsWherever payloads are scannedFalse matches without context; unusual identifiers missedReviewing more payloads than a person can
Monitoring real trafficThe requests real users send to every vendor, with the consent state on web and server-sideAs traffic flows, after every changeOnly the sites, apps, and server containers it is installed onLeaks no planned test covered

This is a selection guide, not a ranking. Most teams need more than one layer.

Browser inspection gives the clearest first answer. The Chrome DevTools Network panel shows each request’s URL, headers, payload, and initiator. Walk the paths where personal data enters the page (forms and their errors, sign-up, search, checkout, password resets, every consent choice) and check the URL, the referrer, and the body, not just the event name. It is precise and manual: right for an incident, wrong as the only control.

Vendor diagnostics are precise but narrow. Google’s guide to troubleshooting consent mode with Tag Assistant shows the default consent state, the update after the banner, and how each tag behaved, including from simulated regions. It doesn’t inventory every request to every other vendor on the page.

Synthetic audits make high-risk paths repeatable. ObservePoint runs audits and defined journeys in a browser, and DataTrue runs journey tests across regions and consent states. They see the states, credentials, and versions in the test plan; real users take the other paths too.

Pattern detection scales the review. It flags values that look like personal data, and it needs context to be useful: a primary pattern such as an email-shaped value, the field or event name around it, an allowlist for test values, a severity level, and masked evidence, so investigating a leak doesn’t create a second copy of it. A match flags a candidate; it can’t decide whether you have a lawful basis to share the value.

Monitoring real traffic answers a different question: what is actually leaving your site, apps, and servers today? It catches the leak that appears after the audit, when a release, a new pixel, a consent change, or a server-side mapping changes the data flow. Code scanning tools such as HoundDog.ai work before any of this, in CI: they stop leaks your developers write, and they don’t see third-party tags, tag manager changes, or anything configured outside your code.

ToolStrongest fitAsk before choosing it
Chrome DevToolsIncident investigation and QAHow will you repeat it across devices, regions, and consent states?
Google Tag AssistantGoogle tags and Consent ModeHow will you check non-Google vendors and server-side forwarding?
ObservePointScheduled web audits and defined journeysWhich paths and states are outside the test plan?
DataTrueScripted web and app tests before releaseWhich production paths are covered between test runs?
HoundDog.aiCode scanning in CIWho covers tags configured outside your code?
TrackingplanReal traffic across web, apps, and server-sideWhere is it installed, and who receives each finding?

Product capabilities change; check the current scope with each vendor during evaluation.

Three things not to blur

Hashing is not anonymization. A hash of an email is still linkable when the input is predictable or the mapping exists elsewhere; the US FTC has said so directly in “No, hashing still doesn’t make your data anonymous”.

A policy review is not payload evidence. A privacy policy, a DPA, or a vendor questionnaire describes intended processing. It doesn’t show what a tag, SDK, server route, or pixel sent.

Detection is not compliance. Detection finds a candidate leak. Minimization, consent enforcement, access control, retention, contracts, and legal judgment decide what the organization does about it.

Who uses PII leak detection

Analytics teams use it to keep GA4 and the rest of the stack within each vendor’s terms. A single ?email= in a URL is enough to put a property at risk, and it usually appears after a release nobody checked.

Paid media teams use it to protect their conversion signals. Ad platforms need matching data to attribute conversions, but in the form they expect: hashed, in the right field, with consent. Raw emails in a pixel URL are a privacy problem and a bad signal at the same time.

DPOs and legal teams use it as evidence. Instead of a yearly audit, they get per-market, per-vendor findings with the hits behind them, ready to show what was sent, where, and since when. Trackingplan observes and reports. It does not block tags or guarantee compliance; it tells the team that owns the tag exactly what to change.

How to prevent PII leaks, and how to set up detection

Prevention starts in your own implementation:

  1. Keep personal data out of URLs. Submit forms with POST, and strip tokens and emails from confirmation and reset links.
  2. Push only what each tag needs. Do not forward whole dataLayer objects to vendors; map the fields explicitly in GTM.
  3. Hash where the platform expects it. Use the fields built for enhanced conversions or advanced matching, not custom parameters.
  4. Turn on vendor-side protection. GA4’s data redaction removes email addresses and the query parameters you list from web events before they are sent, on a best-effort basis.
  5. Monitor after every release. Prevention rules drift. The leaks that matter are the ones introduced after the last audit.

Setting up detection with Trackingplan takes one install: a GTM template or one script tag on the web, the iOS or Android SDK in apps, and the server-side GTM integration for server containers. PII monitoring is part of the Compliance module, together with cookie and consent monitoring; see pricing for the plans that include it. More on the use case on the privacy and compliance page.

For the full audit workflow, from inventory to re-test, use the privacy tracking audit checklist, and for what GDPR, CCPA, and HIPAA ask of your tags, the PII compliance checklist.

A privacy policy says what you intend to collect. Your tracking requests say what you actually send. PII leak detection is how you keep the two the same, on every hit, after every release.

FAQ

What is PII detection in analytics?

PII detection in analytics is finding personal data, such as emails, names, phone numbers, or tokens, inside the tracking requests your site, app, or server sends to analytics and ad platforms. The evidence is the request itself: the field, the vendor that received it, and the consent state at the time.

Which method finds PII leaks best?

Each one proves something different. Browser inspection proves one incident, vendor diagnostics cover one platform, synthetic audits repeat the journeys you define, pattern detection scales the review, and monitoring real traffic catches the leaks that appear after the last test. Most teams need more than one.

Is hashing personal data enough to avoid a leak?

No. A hash of an email is still linkable when the input is predictable or the mapping exists elsewhere, as the US FTC has pointed out. Treat hashing as a control that needs context, not as an exemption.

Go deeper

David PombarSwiss army knife at Trackingplan

Read more from David, a Senior Product Strategist with 18+ years in digital product development and an atypical error detection knack.

Trackingplan

See everything. Miss nothing.

Your implementations audited around the clock with real-time, real-user data. Real-time alerts about errors or changes in your data, campaigns, pixels, privacy and consent. Let AI flag issues before they cost you.