Skip to Content
GenerateSaaS

URL scrubbing

How password-reset and deletion tokens stay out of the URLs each analytics provider records, and the GA4 settings that keep it that way.

No analytics or support script loads while the address bar holds a credential (a reset or deletion ?token=); those pages drop it once read. A script already loaded also records in-app navigations, so each provider's URLs pass through @repo/utils/url-scrub.

ProviderHow a credential is kept out of recorded URLs
PostHog, Umami, browser SentryTheir own before-send hook scrubs every URL
OpenPanelIts filter hook scrubs every event, screen views included
Vercel Analytics, Speed InsightsTheir beforeSend hook scrubs every URL
PlausibleLoads script.manual.js; the app sends each pageview and event with a scrubbed URL
Google Analytics 4send_page_view: false; the app sends each page_view with a scrubbed page_location / page_referrer
DataFast, AhrefsNot covered - no hook. A navigation onto an address carrying a token (a sign-in ?redirect= holding one) reaches them unscrubbed

Google Analytics 4 settings

Admin → Data streams → your web stream → Enhanced measurement → Page views → Show advanced settings: clear Page changes based on browser history events and save. Left on, it sends its own unscrubbed page_view on every in-app navigation and double-counts.

For defence in depth, list token, code and otp under Redact data → URL query parameters.

On this page