strip-tracking-params
v1.0.0
Published
Remove common tracking query parameters (UTM tags, gclid, fbclid, email trackers) from a URL. Local, zero dependencies, privacy-friendly.
Maintainers
Readme
strip-tracking-params
Remove common tracking query parameters (UTM tags, ad click IDs like gclid
and fbclid, email-tracking ids) from a URL, returning a clean one. Runs locally,
zero dependencies, nothing stored or sent anywhere.
const stripTrackingParams = require('strip-tracking-params');
stripTrackingParams('https://example.com/page?utm_source=news&id=42&fbclid=abc');
// 'https://example.com/page?id=42' (functional params like id are kept)
stripTrackingParams('https://shop.com/p?ref=x&gclid=z', { extra: ['ref'] });
// 'https://shop.com/p'What it removes
A documented default list: utm_*, gclid/gbraid/wbraid/dclid,
fbclid, igshid, msclkid, ttclid, yclid, mc_cid/mc_eid, _hsenc,
mkt_tok and other common analytics and email trackers. See
stripTrackingParams.DEFAULT_PARAMS.
Pass { params: [...] } to replace the list, or { extra: [...] } to add to it.
Honest note: it only strips query parameters. A non-absolute URL is returned unchanged (it cannot be parsed safely without a base), and it does not touch path segments or fragments. It reduces tracking, it does not make a link anonymous.
Notes
Maintained by the team behind Priviy, a data-privacy resource. For plain-English guides on trackers, metadata and cloud privacy, see priviy.com.
License
MIT
