Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Email address in URL sent to GA4: how to find and fix it

TRK-355High impactDetectedBy FunnelGuardPublished Updated
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.

How an email travels from the form to GA4
  1. Visitor submits formForm uses GET or redirects with ?email=
  2. Thank-you URL contains email/thank-you?email=jane@example.com
  3. GA4 sends page_viewpage_location includes the email
  4. Email stored in reportsAlso copied to other tags and tools

The leak happens automatically once the email is in the URL.

Thank-you page rows in a GA4 reportExample numbers
Thank-you page rows in a GA4 report (example)With email in URL: 500 rows; Clean URL: 1 rows01923835001With email in URLClean URLrows

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

Check for emails in URLs
  1. Submit your own form

    Use a test email and look at the address bar on the thank-you page. Any @ or %40 in the URL is a problem.

  2. Check GA4 DebugView

    In GA4 go to Admin > DebugView, run the journey, and open the page_view event. Check the page_location parameter.

  3. Search your reports

    In Reports > Engagement > Pages and screens, switch the dimension to Page path + query string and search for @ and %40.

  4. 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.

Stop the email entering the URL
  1. 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].

  2. Use a clean thank-you page

    Redirect to a plain URL such as /thank-you, or show an on-page message.

GTM Custom JavaScript variable: URL with emails redactedjavascript
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

Confirmation checklist
  • 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.
Thank-you page URL

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

Prevention
  • 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: no_pii_in_tracking.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.