On this page
What this issue is
A query string is the part of a URL after the ?. Some forms, email links and redirects put the visitor's email there, for example https://example.com/thank-you?email=jane@example.com. GA4 automatically sends the full page URL with every event as page_location, so the email goes to Google with it.
The same URL can also reach other tools: ad pixels, heatmaps, chat widgets and the dl (document location) field of other vendors. Each copy is personal data you may have no consent or legal basis to share.
Why it costs you leads or sales
The direct cost is risk, not a broken button. Google can ask you to delete affected data, and Analytics accounts that send personal data can be suspended. Under GDPR and similar laws, leaking emails to a third party can mean complaints and fines. Your reports also become messy: every visitor gets a unique URL, so one thank-you page splits into thousands of rows.
- Visitor submits formForm uses GET or redirects with ?email=
- Thank-you URL contains email/thank-you?email=jane@example.com
- GA4 sends page_viewpage_location includes the email
- Email stored in reportsAlso copied to other tags and tools
The leak happens automatically once the email is in the URL.
Example: 500 leads in a month. With emails in the URL, each lead becomes its own row; with clean URLs it is one.
How to check if your site has it
Submit your own form
Use a test email and look at the address bar on the thank-you page. Any
@or%40in the URL is a problem.Check GA4 DebugView
In GA4 go to Admin > DebugView, run the journey, and open the page_view event. Check the page_location parameter.
Search your reports
In Reports > Engagement > Pages and screens, switch the dimension to Page path + query string and search for
@and%40.Check email links
Open links in your own newsletters and automations. Merge tags like
?email={{email}}put addresses in URLs.
How to fix it
Fix it in two layers. First, stop the email entering the URL. Second, redact anything that slips through before tags send it.
Switch the form to POST
In your form plugin settings, make sure the form method is POST, not GET, and that the redirect URL has no field merge tags like
?email=[your-email].Use a clean thank-you page
Redirect to a plain URL such as /thank-you, or show an on-page message.
Check form method
Select the form, then in Settings confirm the method is POST. Set the redirect to a plain page URL.
Edit the redirect
In the form or survey Options, set a redirect URL without contact merge fields such as {{contact.email}}.
Review email and SMS links
Remove merge fields that add the email to links in workflows.
Create a clean URL variable
Create a Custom JavaScript variable that returns the URL with emails removed (code below).
Use it in GA4 tags
In your GA4 configuration or event tag, under Fields to Set, add
page_locationwith that variable. Do the same for other vendors' tags that send the URL.
Use POST and server-side redirects
Submit forms with
method="post". Pass identifiers through a session or an opaque ID, not the email.
function() {
var url = {{Page URL}};
try { url = decodeURIComponent(url); } catch (e) {}
return url.replace(/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g, '[email]');
}How to confirm it's fixed
- Submit a test form and confirm the thank-you URL has no email.
- In GA4 DebugView, page_location on every event is clean.
- In GTM Preview, the URL sent by each tag shows no
@or%40. - Click links from your emails and check the landing URL.
- Search Page path + query string again after a few days for new matches.
Before
- /thank-you?email=jane@example.com
- Email sent to GA4 and other tags
- One report row per lead
After
- /thank-you
- No personal data in page_location
- One clean row for the page
How to prevent it happening again
- Never use email merge fields in links or redirect URLs.
- Review new forms, automations and email templates before launch.
- Keep the GTM redaction variable in all tags that send URLs.
- Re-test key journeys after theme, plugin or form changes.
- Train the team: URLs are not private.
How FunnelGuard handles this
FunnelGuard detects this today. A robot visitor runs your real journeys, such as lead forms, on a schedule and records the tracking hits sent to GA4 and other platforms. The no_pii_in_tracking check looks at those requests and flags when personal data, such as an email address, appears in what is sent. Failures are re-checked from a second region before one alert goes out with a screenshot and a likely cause.
The robot uses test data and marks its traffic (utm_source=funnelguard, fg_test=1). The Free plan covers 1 site and 2 journeys with daily checks, no card needed, and paid plans have a 3-day free trial.
Questions people ask
Why is my email address showing in GA4 page URLs?
Your form, redirect or email link is adding the email to the URL, such as ?email=name@example.com. GA4 sends the full URL as page_location, so it is recorded automatically. Remove the email from the URL at the source.
Is it against Google's rules to send emails to GA4?
Yes. Google Analytics terms prohibit sending personally identifiable information, including email addresses, to Analytics. Accounts that do so can face data deletion or suspension.
How do I remove an email from the GA4 page URL?
Stop the form or link adding it, then use a Google Tag Manager Custom JavaScript variable to replace emails in the URL, and set it as page_location in your GA4 tags. Test in DebugView.
Does fixing the URL delete emails already in GA4?
No. Past data stays until it is deleted. Use Google's data deletion options and consult your privacy lead about what else is required.
How can I find emails in my GA4 reports?
In Pages and screens, use the Page path + query string dimension and search for @ and %40. DebugView also shows page_location for live test sessions.
Do other tools receive the email too?
Often yes. Ad pixels, heatmaps and chat tools commonly read the page URL, so the same email can be copied to several vendors. Redact the URL in each tag.
Can FunnelGuard tell me if my site sends emails in URLs?
Yes. Its no_pii_in_tracking check inspects the tracking hits sent during a monitored journey and alerts you when personal data such as an email appears.
Related issues
- TRK-357Name or address in thank-you URL sent to pixelsFix guide
- TRK-359PII in page_title ("Thanks John")Fix guide
- TRK-360PII in dataLayer pushed to all vendorsFix guide
- TRK-361Hashed PII sent without consentFix guide
- TRK-358Form field values sent in GA4 click textFix guide
- TRK-356Phone number in event parametersFix guide