Add email and ad click identifiers to globalRules
Covers the open part of #171 by @vigneshrajarr (_hsmi; _hsenc is already in globalRules) and the _kx part of #219 by @mkbloke.
Prerequisites
- This rule only prevents tracking.
- This rule does not destroy the function of the page.
Description
Email service providers and ad networks append a per-recipient or per-click identifier to every link. These ids tie the visit to a person or a click, they are not needed to show the page. Each name below is documented by the vendor itself as a tracking or attribution parameter:
The names are specific enough not to collide with functional parameters: every rule matches the whole key, and the prefixed groups (hsa_, ajs_, sp, trk_, at_recipient_) are spelled out instead of using a wildcard. The existing globalRules exceptions keep applying.
Not included on purpose:
sourcefrom #219: a generic name used by many sites for real content.- Click-tracking redirects such as
trk.klclick.com/ls/click?upn=…from #219: the destination is encoded on the server and cannot be extracted offline. _bhlid(Beehiiv): already proposed on the GitHub mirror in GitHub PR 190 by @alvincrespo.
Affected fields
rulesofglobalRules, appended at the end
Change in data.min.json (globalRules.rules, appended)
[
"(?:%3F)?_hsmi",
"(?:%3F)?hsa_(?:acc|ad|cam|grp|kw|mt|net|src|tgt|ver)",
"(?:%3F)?_kx",
"(?:%3F)?_cio_id",
"(?:%3F)?ajs_(?:uid|aid|event|prop_[a-z0-9_]+|trait_[a-z0-9_]+)",
"(?:%3F)?sh_kit",
"(?:%3F)?sp(?:MailingID|UserID|JobID|ReportId)",
"(?:%3F)?omnisendContactID",
"(?:%3F)?at_recipient_(?:id|list)",
"(?:%3F)?trk_(?:msg|contact)",
"(?:%3F)?ttclid",
"(?:%3F)?li_fat_id",
"(?:%3F)?[gw]braid"
]Example URLs
| URL | Result |
|---|---|
https://shop.example.com/item?id=7&_hsmi=Abc123&color=red#top |
https://shop.example.com/item?id=7&color=red#top |
https://shop.example.com/item?_kx=Q%3D.x&id=7 |
https://shop.example.com/item?id=7 |
https://shop.example.com/item?id=7&spMailingID=Abc123&color=red#top |
https://shop.example.com/item?id=7&color=red#top |
https://shop.example.com/item?id=7&gbraid=Abc123&color=red#top |
https://shop.example.com/item?id=7&color=red#top |
https://shop.example.com/item?id=7&kx=Abc123&color=red#top |
unchanged, other parameter |
https://shop.example.com/item?id=7&sp=Abc123&color=red#top |
unchanged, other parameter |
https://shop.example.com/item?id=7&trk_id=Abc123&color=red#top |
unchanged, other parameter |
https://github.com/org/repo/issues?q=x&_hsmi=1 |
unchanged, globalRules exception |
Testing
Tested offline in URL Check 3.5 (Android 15 emulator), which applies this catalog with Java regexes: 33 of 33 parameter cases as expected (every new name removed in 20 cases, 12 similar names kept, 1 globalRules exception kept), 50 of 50 together with the two companion changes. Without the change none of the 20 parameters is removed. Inputs up to 160 KB (long hosts, many parameters, long tokens) took at most 10 ms per pattern in Java and 8 ms in JavaScriptCore, with no stack overflow at a 512 KB thread stack.
Companion MRs: !88 (LinkedIn redirections), !89 (instagram and vk.com redirections). The three change different fields and merge without conflict in any order.
AI-Assisted-By: Claude Opus 5.5 (xhigh)