PII in URLs: How to Use GA4 Data Redaction to Keep Emails Out of Analytics
A practical guide for marketers who find email addresses or other personal data in GA4 page URLs: how to spot it, how to set up data redaction, what the feature misses, and how to fix the forms and redirects that cause it.
In short
GA4 data redaction is a web data stream setting that removes likely email addresses and the URL query parameters you name from events before they leave the browser. Turn it on in Admin, Data streams, your web stream, Redact data. It is best-effort, web only, and ignores Measurement Protocol, Data Import and data already collected.
If you can see email addresses in GA4 page URLs, for example /thank-you?email=jane%40example.com, the fastest fix is data redaction: a setting on your web data stream that removes likely email addresses and any URL query parameters you name before the event is sent. It takes a few minutes and needs no code. It is also only half the job. Redaction is best-effort, it works only for the GA4 tag, and every other tag on the page still sees the full URL. This guide shows how to find the problem, switch redaction on, test it, and fix the forms and redirects that put personal data in URLs in the first place.
Why an email in a URL is a problem beyond GA4
Google's Analytics policy asks that no data be passed to Google that it could use or recognise as personally identifiable information (PII). Its help page names email addresses, personal mobile numbers and social security numbers as examples, says both the URL path and the query string must be free of PII, and lists UTM parameters, custom dimensions and site search terms as places that need special care. GA4 collects the full URL of every page view as the page_location parameter, so an email in the address bar goes straight into your reports.
The same URL is readable by every script on the page. Meta's developer documentation says the PageView event its pixel sends automatically each time it loads records the URL of the page that triggered it (Meta calls this the referrer URL), and other ad pixels, chat widgets and session recorders can read the address bar too. Turning on redaction in GA4 changes nothing for those tools. That is why the long-term fix is to stop the email reaching the URL, covered in the last section.
How to find personal data in your GA4 URLs
The quickest check is a free-form exploration. In GA4, click Explore in the left menu and start a blank exploration, which opens as a free form table. In the Variables panel, click the add icon next to Dimensions and import Page path + query string and Page referrer, then add Views as a metric. Double-click Page path + query string to put it in Rows. Then, in the Filters section at the bottom of Tab settings, choose that dimension, pick a match type that finds text anywhere in the value, such as contains (Google's help says the options offered depend on the dimension), enter @ and click Apply. Repeat it with %40, the encoded form of @ that many forms produce, and with each parameter name below. Filter expressions are case sensitive, so try email= and Email= separately.
| What to search for | Where it usually comes from |
|---|---|
| @ or %40 | Email addresses in any query parameter or in the path |
| email=, e=, mail= | Newsletter sign-up redirects and email platform links |
| name=, firstname=, lastname= | Lead forms that pass answers to a thank-you page |
| phone=, tel=, mobile= | Booking and callback forms |
| q=, s=, search= | Site search, where visitors type their own details |
Set the date range as wide as your data retention setting allows, because explorations cannot look further back than that. Note the parameter names that turn up: you will need them for the redaction list and for the clean-up. Check Page referrer as well, because the page after a leaky thank-you page often carries the same email in its referrer.
How to turn on data redaction in GA4
You need the Editor role or above on the property. Redaction is set per web data stream, so repeat the steps if the property has more than one website stream.
- 1Click Admin and check that the property selector at the top shows the right property.
- 2Under Data collection and modification, click Data streams, then click your web stream.
- 3In the Events section, click Redact data.
- 4Turn on the switch for email addresses. On properties created since the feature launched this is already on, but older properties have to switch it on by hand.
- 5Turn on the switch for URL query parameters, type each parameter name you found, such as email or firstname, and press Enter after each one.
- 6Use the test box on the same screen, described below, before you leave.
List only parameters that carry personal data. Redacting a campaign parameter such as utm_content or a click ID would remove values GA4 needs to credit traffic to the right campaign, and your attribution would suffer.
What data redaction covers, and what it misses
Google's help page on data redaction is clear about the scope. Email matching runs across all event parameters. Query parameter redaction is narrower: it only looks at six URL-type parameters, which are page_location, page_referrer, page_path, link_url, video_url and form_destination. A parameter called email inside a custom event parameter you built yourself will not be redacted by the query parameter list, although the email pattern may still catch the address.
| Situation | Does redaction help? |
|---|---|
| Email in page_location or page_referrer from a web stream | Yes, by email pattern and by query parameter name |
| Name or phone number in a query parameter you listed | Yes, in the six URL parameters only |
| Name or phone number not in a URL and not in your list | No, it only matches email patterns and named parameters |
| Events from Android or iOS app streams | No, the setting exists only for web streams |
| Events sent through the Measurement Protocol or Data Import | No, these bypass the browser tag |
| Data GA4 has already collected | No, redaction runs before collection |
Three more limits matter in practice. Email detection is best-effort and can over-redact: Google warns that text with an @ followed by a top-level domain may be removed even when it is not an address. Redaction runs client-side, after GA4 has created the event and before it is sent, and it does not evaluate HTTP header values such as the referer header. And the value of the cross-domain parameter _gl is replaced with xxxxxxx in collected URLs, so if you use cross-domain tracking, seeing that placeholder in reports is the redaction at work. Percent-encoded and Unicode parameter names are supported. Google also states that compliance remains your responsibility, not the feature's.
If you send events to GA4 from a server, see our guide to the Measurement Protocol. Whatever builds those requests must remove personal data itself, because no GA4 setting will.
How to test redaction before you rely on it
The Redact data screen has a Test data redaction section. Paste a sample URL with the parameters you configured and made-up values, such as https://example.com/thanks?email=test%40example.com&firstname=John, and click Preview redacted data. The Redacted version box shows what GA4 would keep, for example firstname=(redacted). Try a few real URLs from your exploration too, including encoded ones.
Then check live traffic. Open your site with debug mode on, through Tag Assistant or Tag Manager preview mode, and go to Admin, then DebugView under Data display. Submit the form that caused the problem, click the page_view event in the Seconds stream and look at page_location. If the email is still there, the parameter name in your list does not match what the site sends. Our DebugView guide covers the setup in more detail.
Fix the source, then clean up what is already stored
Redaction hides the symptom in one tool. The real fix is to stop personal data appearing in URLs, which protects every tag on the page and every log file on the way.
- Switch forms from GET to POST. A GET form appends every field to the URL as name and value pairs, while POST sends them in the request body, which is why MDN advises never using GET for sensitive data.
- Stop thank-you redirects from carrying answers. If the thank-you page needs to greet someone by name, read it from the session on the server instead of the query string.
- Use an opaque ID when a later page needs to know who submitted, such as a random lead reference that means nothing outside your own database.
- Check your email templates. If a merge field adds the subscriber's address to link URLs, remove it from the links.
- Keep UTM values free of names and addresses. Our guide to UTM parameters for email shows tags that identify the campaign, not the reader.
For data already collected, use a data deletion request: Admin, then Data deletion request under Data collection and modification. Choose Delete all parameters on all events for the affected dates, because auto-collected parameters such as page_location can only be removed with that type, and then select Only delete parameter values that contain the following text, entering text such as email= or %40 so only the affected values go. Data must be more than 12 days old, you can cancel within the first 7 days, and processing takes 7 to 63 days. Google warns that once a deletion completes, historical campaign information for those events is no longer available for attribution, so later conversions may be credited to other campaigns or to Direct. If you have a roll-up property, it needs its own request.
The same applies to any other tool that stores full URLs. EndFrame, for example, stores the query parameters of each visit alongside its UTM values, so an email in a landing page URL would be stored there as well. GA4 redaction does not reach it, which is one more reason to fix the form or redirect rather than filter each tool. For the wider legal picture, see whether Google Analytics is GDPR compliant.
Frequently asked questions
Is GA4 email redaction turned on by default?
For properties created after the feature launched, email redaction is on by default. Older properties have to be set up by hand, so check the Redact data screen on each web stream rather than assuming. Query parameter redaction only does something once you have typed in the parameter names you want removed.
Can data redaction break my campaign tracking?
It can if you redact the wrong parameters. Redacting utm_content or gclid would strip values GA4 needs for attribution, so list only parameters that carry personal data. Email matching can also remove harmless text that looks like an address, such as a social handle followed by a domain, so check your reports after switching it on.
Does redaction stop GA4 receiving PII from my server?
No. Redaction runs inside the browser tag on web streams. Events sent from a server through the Measurement Protocol, and files uploaded through Data Import, never pass through it. Any system that sends events to GA4 that way has to strip personal data before it sends.
Sources
- 1.[GA4] Data redaction - Analytics Help
- 2.Best practices to avoid sending Personally Identifiable Information (PII) - Analytics Help
- 3.[GA4] Data-deletion requests - Analytics Help
- 4.Monitor events in DebugView - Analytics Help
- 5.Sending form data - Learn web development | MDN
- 6.Conversion Tracking - Meta Pixel - Meta for Developers
Try EndFrame
Add a server-side path for your conversions.
EndFrame collects events first-party and forwards conversions server-side to Meta, GA4, TikTok, and webhooks with event-ID deduplication — then credits each conversion to its campaign, with the visit-to-conversion path you can audit.
No credit card required