PII in URLs — The Data Leak Nobody Checks
Email addresses, names, and tokens in URLs are copied into analytics tools, server logs, browser history, and referrer headers. Learn how personal data ends up in URLs, where it spreads, and how to find and fix it.
Short answer: a URL is recorded in more places than almost any other piece of data: analytics tools, server and CDN logs, browser history, bookmarks, and the referrer sent to other sites. Masking protects what is on the page. It does not protect the address of the page. If a URL contains an email address, a name, or a token, that value has been copied to every one of those places.
Table of Contents
- How Personal Data Gets Into URLs
- Where a URL Travels
- Why Masking Does Not Help
- How to Find It
- How to Fix It
- Key Takeaways
How Personal Data Gets Into URLs
Nobody sets out to do this. It arrives through ordinary features.
| Source | Example |
|---|---|
| Forms submitted with GET | /search?email=jane@example.com |
| Email links with prefilled fields | /unsubscribe?email=jane@example.com |
| Password reset and magic links | /reset?token=abc123 |
| Usernames in paths | /users/jane.doe/settings |
| Search queries | /search?q=jane+doe+diagnosis |
| Campaign links with a customer ID | ?utm_content=customer-4471 |
| Prefilled checkout | /checkout?name=Jane&phone=5550100 |
| Invitations | /invite?to=jane@example.com |
| Order tracking | /track?order=88231&postcode=12345 |
| Third-party redirects | A payment or login provider returning with details in the query string |
Search queries deserve particular mention. People type names, medical terms, and account numbers into search boxes, and many sites put the query in the URL.
Where a URL Travels
Once a value is in a URL, it is written to:
- Your web server logs
- CDN and proxy logs
- Every analytics tool on the page, as the page path or location
- Session recording tools, as the page URL of the session
- Advertising pixels
- Error tracking tools, in the context of each error
- The visitor's browser history and bookmarks
- The referrer header, sent to any other site the visitor clicks through to, depending on your referrer policy
- Shared links, when the visitor copies the address
- Screenshots and support tickets
Many of these are third parties, each with its own retention and access controls. A deletion request now has a dozen places to chase.
For tokens, the risk is direct. A password reset token in a URL that reaches a third-party script or a referrer header can be used by someone else.
Why Masking Does Not Help
Session replay masking operates on the page's content: it replaces the text of inputs and marked elements before anything is sent. The URL is not page content. It is metadata recorded alongside every page view, by every tool.
So a site can have exemplary masking and still send an email address to five vendors on every load of an unsubscribe page.
The same care applies to anything you send deliberately. Event names, event properties, campaign parameters, and user attributes are all stored as provided. DeepSync's docs make this point about the identify call: whatever you pass is stored and visible in the dashboard, so send only what you would be comfortable having a teammate read.
How to Find It
- Search your analytics page report. Look for
@,email=,name=,phone=,token=,key=, andpassword. - Review query parameters. Export the distinct parameter names your site receives and read the list.
- Check top pages for paths containing names or usernames.
- Look at your site search report. Read a sample of the queries.
- Follow your own emails. Click every link in your transactional and marketing emails and read the address bar.
- Walk through flows that leave and return: login providers, payment, verification.
- Search server logs with the same patterns.
- Check what your forms use. A form using GET puts every field in the URL.
Do this once thoroughly, then after any change to email templates, authentication, or checkout.
How to Fix It
At the source
- Use POST for forms that contain personal data.
- Use opaque identifiers.
/users/8f3a2cinstead of/users/jane.doe. - Put tokens in the fragment or exchange them immediately. Handle a reset or magic-link token on arrival, then redirect to a clean URL before other scripts run.
- Do not prefill forms from the query string. Look the data up server-side from an opaque reference.
- Keep customer identifiers out of campaign parameters (UTM guide).
- Submit site search by POST, or accept that queries are sensitive and exclude search pages from third-party tools.
As a safety net
- Clean the URL before analytics loads. Remove sensitive parameters with the History API so later scripts see a clean address.
- Set a strict referrer policy, such as
strict-origin-when-cross-origin, so full URLs are not sent to other sites. - Do not load third-party scripts on reset, verification, and similar pages.
- Configure parameter exclusion in tools that support it.
- Redact in logs where your infrastructure allows.
For what has already leaked
- Expire any exposed tokens.
- Ask vendors to delete affected data, or use their deletion tools.
- Record the incident and assess whether it must be reported under the laws that apply to you.
Search your page report for the @ symbol
It takes thirty seconds and finds the most common case immediately.
Key Takeaways
- URLs are copied into logs, analytics, history, and referrers.
- Masking protects page content, not the address.
- Search your reports for emails, names, and tokens.
- Fix it at the source with POST and opaque identifiers.
Conclusion
Personal data in URLs is the leak that survives every privacy review, because nobody looks at the address bar. Look at it.
Frequently Asked Questions
Related articles
Stay in the loop
Get the latest insights on product analytics and user behavior delivered to your inbox.



