Files
MalinandClaude Sonnet 5 c642f7e9a3 feat: add Clean URL Tracking Params userscript
Strips fbclid/gclid/utm_*/msclkid/ttclid and other known ad-tracking
query params from the URL bar via history.replaceState -- no reload,
no network requests. Handles SPA navigation too (pushState/replaceState
wrapping, popstate/hashchange), since client-side routers often re-add
tracking params on route changes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-18 05:20:39 +02:00

1.1 KiB

Clean URL Tracking Params

Strips known ad/tracking query parameters (fbclid, gclid, utm_*, msclkid, ttclid, and more — see the full list in the script) from the URL bar on page load and on single-page-app navigation, using history.replaceState. The page never reloads and nothing is ever sent anywhere — this only rewrites the URL already sitting in your own address bar.

Only well-known ad-network/analytics-specific parameter names are stripped. Generic-sounding params like ref, source, or id are deliberately left alone, since real sites often depend on those for actual navigation — this script only touches names that are unambiguously tracking-only.

Scope note: this is a cosmetic/privacy URL cleanup, not a network-level tracker blocker. If a tracking pixel already read the param before this script ran, cleaning the URL afterward doesn't un-fire it. Pair with a real request-blocking extension (uBlock Origin, etc.) if that's the goal — this script just keeps the URL itself clean to look at, copy, and share.

Installing

See the repo README.