From 8cc8e18dddcbd2d42620ffc64181d73eee0e9f0a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 18 Oct 2026 18:36:55 +0000 Subject: [PATCH 1/3] feat(engine): add 18 documented tracking parameters Expand global TRACKING_PARAMETERS with Adobe, TikTok, Iterable, Braze, Partnerize, Adjust, X intent, HubSpot, and Zanox ids. Complements open PR #23 without duplicating its parameter set or HOST_RULES work. Co-authored-by: Andromeda --- cleaner.js | 6 ++- explanations.js | 20 ++++++++- tests/tracking-parameters-additions.test.js | 49 +++++++++++++++++++++ 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 tests/tracking-parameters-additions.test.js diff --git a/cleaner.js b/cleaner.js index bb88f36..6a964b9 100644 --- a/cleaner.js +++ b/cleaner.js @@ -11,7 +11,11 @@ export const TRACKING_PARAMETERS = new Set([ "ck_subscriber_id", "dm_i", "mibextid", "_openstat", "rb_clickid", "s_cid", "s_fid", "s_ppv", "s_channel", "s_ptc", "s_plt", "s_vnum", "s_invisit", "s_cc", "s_sq", "vero_conv", "vero_id", "igshid", "igsh", - "pk_campaign", "pk_kwd", "pk_source", "pk_medium", "pk_content", "pk_cid" + "pk_campaign", "pk_kwd", "pk_source", "pk_medium", "pk_content", "pk_cid", + "adobe_mc", "adobe_mc_sdid", "icid", "tt_medium", "tt_content", "clickref", + "iterable_campaign_id", "iterable_template_id", "iterable_link_id", "braze_c_id", + "twcamp", "twsrc", "adj_t", "adj_campaign", "adj_adgroup", "adj_creative", + "zanpid", "_hsq" ]); export const TRACKING_PARAMETER_PREFIXES = ["utm_", "hsa_", "mtm_", "piwik_", "_ga_"]; diff --git a/explanations.js b/explanations.js index 85ffbb5..23db430 100644 --- a/explanations.js +++ b/explanations.js @@ -81,7 +81,25 @@ export const PARAMETER_EXPLANATIONS = { pk_medium: "Matomo campaign medium.", pk_content: "Matomo campaign content.", pk_cid: "Matomo campaign identifier.", - si: "Share identifier added to links copied from YouTube and Spotify; removed only on those sites." + si: "Share identifier added to links copied from YouTube and Spotify; removed only on those sites.", + adobe_mc: "Adobe Experience Cloud visitor ID (mid) passed between Experience Cloud solutions.", + adobe_mc_sdid: "Adobe Experience Cloud supplemental ID (SDID) for cross-domain identity.", + icid: "Adobe Analytics internal campaign identifier (ICID) on tracked marketing links.", + tt_medium: "TikTok marketing medium tag on shared or ads links (parallel to utm_medium).", + tt_content: "TikTok marketing content tag used to distinguish creatives on the same campaign.", + clickref: "Partnerize (formerly Performance Horizon) affiliate click reference.", + iterable_campaign_id: "Iterable email campaign identifier on tracked links.", + iterable_template_id: "Iterable email template identifier on tracked links.", + iterable_link_id: "Iterable tracked link identifier for message attribution.", + braze_c_id: "Braze campaign identifier on email or messaging links.", + twcamp: "X (Twitter) web intent campaign name parameter on share/intent URLs.", + twsrc: "X (Twitter) web intent source parameter on share/intent URLs.", + adj_t: "Adjust mobile attribution transaction parameter.", + adj_campaign: "Adjust mobile attribution campaign name.", + adj_adgroup: "Adjust mobile attribution ad group name.", + adj_creative: "Adjust mobile attribution creative name.", + zanpid: "Zanox / Awin affiliate click identifier (zanpid).", + _hsq: "HubSpot analytics queue parameter on tracked pages and links." }; export const PREFIX_EXPLANATIONS = { diff --git a/tests/tracking-parameters-additions.test.js b/tests/tracking-parameters-additions.test.js new file mode 100644 index 0000000..2bab388 --- /dev/null +++ b/tests/tracking-parameters-additions.test.js @@ -0,0 +1,49 @@ +import test from "node:test"; +import assert from "node:assert/strict"; +import { cleanUrl } from "../cleaner.js"; + +const NEW_TRACKERS = [ + { name: "adobe_mc", source: "Adobe Experience Cloud MID parameter (Adobe docs)" }, + { name: "adobe_mc_sdid", source: "Adobe Experience Cloud SDID (Adobe docs)" }, + { name: "icid", source: "Adobe Analytics ICID campaign id (Adobe Analytics)" }, + { name: "tt_medium", source: "TikTok marketing URL tags (TikTok Business / ClearURLs-style tt_ params)" }, + { name: "tt_content", source: "TikTok marketing URL tags (TikTok Business)" }, + { name: "clickref", source: "Partnerize affiliate clickref (Partnerize docs)" }, + { name: "iterable_campaign_id", source: "Iterable link tracking (Iterable API/docs)" }, + { name: "iterable_template_id", source: "Iterable link tracking (Iterable API/docs)" }, + { name: "iterable_link_id", source: "Iterable link tracking (Iterable API/docs)" }, + { name: "braze_c_id", source: "Braze campaign id on links (Braze docs)" }, + { name: "twcamp", source: "X web intent share parameters (X developer docs)" }, + { name: "twsrc", source: "X web intent share parameters (X developer docs)" }, + { name: "adj_t", source: "Adjust attribution parameters (Adjust help center)" }, + { name: "adj_campaign", source: "Adjust attribution parameters (Adjust help center)" }, + { name: "adj_adgroup", source: "Adjust attribution parameters (Adjust help center)" }, + { name: "adj_creative", source: "Adjust attribution parameters (Adjust help center)" }, + { name: "zanpid", source: "AdGuard URL Tracking filter / Zanox affiliate (zanpid)" }, + { name: "_hsq", source: "HubSpot _hsq tracking (HubSpot / AdGuard lists)" } +]; + +for (const { name } of NEW_TRACKERS) { + test(`removes new tracking parameter ${name}`, () => { + const url = `https://example.com/page?id=42&${name}=track123`; + const result = cleanUrl(url); + assert.equal(result.url, "https://example.com/page?id=42"); + assert.ok(result.removedParameters.includes(name)); + assert.equal(result.changed, true); + }); +} + +test("functional query params stay without aggressive mode", () => { + const cases = [ + "https://example.com/search?q=hello&lang=en&page=2&id=9", + "https://shop.example/item?ref=homepage", + "https://app.example/auth?session=abc123&token=def456", + "https://wiki.example/wiki/Topic?action=edit" + ]; + for (const input of cases) { + const result = cleanUrl(input); + assert.equal(result.url, input, input); + assert.equal(result.changed, false, input); + assert.deepEqual(result.removedParameters, [], input); + } +}); From 2ee14f90c66e3cc77bfffa2881eb35278019bc08 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 24 Oct 2026 11:38:52 +0000 Subject: [PATCH 2/3] fix(engine): correct tracking param names per vendor docs (PR #29 review) Drop adj_t (Adjust link token on *.adj.st). Replace HubSpot _hsq with __hstc/__hssc/__hsfp/__hssrc. Use X ref_src/ref_url. Fix Iterable names per Shopify integration docs; drop unverified braze_c_id. Move clickref and zanpid to aggressive-only. Expand tests with realistic URLs. Co-authored-by: Andromeda --- cleaner.js | 13 +- explanations.js | 30 ++-- tests/tracking-parameters-additions.test.js | 143 ++++++++++++++++---- 3 files changed, 143 insertions(+), 43 deletions(-) diff --git a/cleaner.js b/cleaner.js index 6a964b9..5556a22 100644 --- a/cleaner.js +++ b/cleaner.js @@ -12,10 +12,12 @@ export const TRACKING_PARAMETERS = new Set([ "s_fid", "s_ppv", "s_channel", "s_ptc", "s_plt", "s_vnum", "s_invisit", "s_cc", "s_sq", "vero_conv", "vero_id", "igshid", "igsh", "pk_campaign", "pk_kwd", "pk_source", "pk_medium", "pk_content", "pk_cid", - "adobe_mc", "adobe_mc_sdid", "icid", "tt_medium", "tt_content", "clickref", - "iterable_campaign_id", "iterable_template_id", "iterable_link_id", "braze_c_id", - "twcamp", "twsrc", "adj_t", "adj_campaign", "adj_adgroup", "adj_creative", - "zanpid", "_hsq" + "adobe_mc", "adobe_mc_sdid", "icid", "tt_medium", "tt_content", + "adj_campaign", "adj_adgroup", "adj_creative", + "__hstc", "__hssc", "__hsfp", "__hssrc", "ref_src", "ref_url", + "iterable_campaign", "iterable_template", + "__iterable_campaign_id", "__iterable_template_id", + "_iterable_campaign_id", "_iterable_template_id" ]); export const TRACKING_PARAMETER_PREFIXES = ["utm_", "hsa_", "mtm_", "piwik_", "_ga_"]; @@ -25,7 +27,8 @@ export const TRACKING_PARAMETER_PREFIXES = ["utm_", "hsa_", "mtm_", "piwik_", "_ export const AGGRESSIVE_PARAMETERS = new Set([ "affiliate", "affiliate_id", "affid", "aff_id", "campaign", "campaignid", "clickid", "click_id", "partner", "partner_id", "ref", "referrer", - "referral", "source", "src", "tracking", "tracking_id" + "referral", "source", "src", "tracking", "tracking_id", + "clickref", "zanpid" ]); export const YOUTUBE_HOSTS = new Set([ diff --git a/explanations.js b/explanations.js index 23db430..4591b78 100644 --- a/explanations.js +++ b/explanations.js @@ -87,19 +87,23 @@ export const PARAMETER_EXPLANATIONS = { icid: "Adobe Analytics internal campaign identifier (ICID) on tracked marketing links.", tt_medium: "TikTok marketing medium tag on shared or ads links (parallel to utm_medium).", tt_content: "TikTok marketing content tag used to distinguish creatives on the same campaign.", - clickref: "Partnerize (formerly Performance Horizon) affiliate click reference.", - iterable_campaign_id: "Iterable email campaign identifier on tracked links.", - iterable_template_id: "Iterable email template identifier on tracked links.", - iterable_link_id: "Iterable tracked link identifier for message attribution.", - braze_c_id: "Braze campaign identifier on email or messaging links.", - twcamp: "X (Twitter) web intent campaign name parameter on share/intent URLs.", - twsrc: "X (Twitter) web intent source parameter on share/intent URLs.", - adj_t: "Adjust mobile attribution transaction parameter.", - adj_campaign: "Adjust mobile attribution campaign name.", - adj_adgroup: "Adjust mobile attribution ad group name.", - adj_creative: "Adjust mobile attribution creative name.", - zanpid: "Zanox / Awin affiliate click identifier (zanpid).", - _hsq: "HubSpot analytics queue parameter on tracked pages and links." + adj_campaign: "Adjust campaign label on destination URLs (not the adj.st link token).", + adj_adgroup: "Adjust ad group label on destination URLs.", + adj_creative: "Adjust creative label on destination URLs.", + __hstc: "HubSpot visitor tracking cookie value appended as a cross-domain link parameter.", + __hssc: "HubSpot session tracking cookie value appended as a cross-domain link parameter.", + __hsfp: "HubSpot fingerprint cookie value appended as a cross-domain link parameter.", + __hssrc: "HubSpot session-reset flag appended when HubSpot rotates session cookies.", + ref_src: "X (Twitter) embed or share referrer source tag (distinct from generic ref).", + ref_url: "X (Twitter) embed or share referrer URL tag.", + iterable_campaign: "Iterable Shopify integration campaign id query parameter.", + iterable_template: "Iterable Shopify integration template id query parameter.", + __iterable_campaign_id: "Iterable cart-attribution campaign id (Shopify integration).", + __iterable_template_id: "Iterable cart-attribution template id (Shopify integration).", + _iterable_campaign_id: "Alternate Iterable cart-attribution campaign id key.", + _iterable_template_id: "Alternate Iterable cart-attribution template id key.", + clickref: "Partnerize affiliate click reference (removed only with aggressive mode).", + zanpid: "Awin / Zanox affiliate click identifier (removed only with aggressive mode)." }; export const PREFIX_EXPLANATIONS = { diff --git a/tests/tracking-parameters-additions.test.js b/tests/tracking-parameters-additions.test.js index 2bab388..a7d0fa6 100644 --- a/tests/tracking-parameters-additions.test.js +++ b/tests/tracking-parameters-additions.test.js @@ -1,44 +1,137 @@ import test from "node:test"; import assert from "node:assert/strict"; import { cleanUrl } from "../cleaner.js"; +import { PARAMETER_EXPLANATIONS } from "../explanations.js"; -const NEW_TRACKERS = [ - { name: "adobe_mc", source: "Adobe Experience Cloud MID parameter (Adobe docs)" }, - { name: "adobe_mc_sdid", source: "Adobe Experience Cloud SDID (Adobe docs)" }, - { name: "icid", source: "Adobe Analytics ICID campaign id (Adobe Analytics)" }, - { name: "tt_medium", source: "TikTok marketing URL tags (TikTok Business / ClearURLs-style tt_ params)" }, - { name: "tt_content", source: "TikTok marketing URL tags (TikTok Business)" }, - { name: "clickref", source: "Partnerize affiliate clickref (Partnerize docs)" }, - { name: "iterable_campaign_id", source: "Iterable link tracking (Iterable API/docs)" }, - { name: "iterable_template_id", source: "Iterable link tracking (Iterable API/docs)" }, - { name: "iterable_link_id", source: "Iterable link tracking (Iterable API/docs)" }, - { name: "braze_c_id", source: "Braze campaign id on links (Braze docs)" }, - { name: "twcamp", source: "X web intent share parameters (X developer docs)" }, - { name: "twsrc", source: "X web intent share parameters (X developer docs)" }, - { name: "adj_t", source: "Adjust attribution parameters (Adjust help center)" }, - { name: "adj_campaign", source: "Adjust attribution parameters (Adjust help center)" }, - { name: "adj_adgroup", source: "Adjust attribution parameters (Adjust help center)" }, - { name: "adj_creative", source: "Adjust attribution parameters (Adjust help center)" }, - { name: "zanpid", source: "AdGuard URL Tracking filter / Zanox affiliate (zanpid)" }, - { name: "_hsq", source: "HubSpot _hsq tracking (HubSpot / AdGuard lists)" } +const NEW_GLOBAL_TRACKERS = [ + "adobe_mc", + "adobe_mc_sdid", + "icid", + "tt_medium", + "tt_content", + "adj_campaign", + "adj_adgroup", + "adj_creative", + "__hstc", + "__hssc", + "__hsfp", + "__hssrc", + "ref_src", + "ref_url", + "iterable_campaign", + "iterable_template", + "__iterable_campaign_id", + "__iterable_template_id", + "_iterable_campaign_id", + "_iterable_template_id" ]; -for (const { name } of NEW_TRACKERS) { - test(`removes new tracking parameter ${name}`, () => { +const AGGRESSIVE_AFFILIATE = ["clickref", "zanpid"]; + +const REALISTIC = [ + { + name: "adobe_mc", + input: "https://www.adobe.com/products/photoshop.html?adobe_mc=TS%7C123&promoid=ABC", + expected: "https://www.adobe.com/products/photoshop.html?promoid=ABC" + }, + { + name: "icid", + input: "https://www.adobe.com/creativecloud.html?icid=cc_teams_banner&promoid=XYZ", + expected: "https://www.adobe.com/creativecloud.html?promoid=XYZ" + }, + { + name: "HubSpot cross-domain", + input: "https://www.example.com/pricing?__hstc=1.abc&__hssc=1.abc&__hsfp=999&plan=pro", + expected: "https://www.example.com/pricing?plan=pro" + }, + { + name: "X embed ref tags", + input: "https://x.com/jack/status/20?ref_src=twsrc%5Etfw&ref_url=https%3A%2F%2Fexample.com", + expected: "https://x.com/jack/status/20" + }, + { + name: "Iterable Shopify params", + input: "https://shop.example/products/hat?iterable_campaign=12345&iterable_template=67890&color=blue", + expected: "https://shop.example/products/hat?color=blue" + }, + { + name: "Adjust destination labels", + input: "https://landing.example/app?adj_campaign=launch&adj_adgroup=search&adj_creative=hero&id=1", + expected: "https://landing.example/app?id=1" + }, + { + name: "TikTok tt_ tags", + input: "https://www.tiktok.com/@user/video/1?tt_medium=share&tt_content=cta&lang=en", + expected: "https://www.tiktok.com/@user/video/1?lang=en" + } +]; + +for (const { name, input, expected } of REALISTIC) { + test(`realistic URL: strips ${name}`, () => { + const result = cleanUrl(input); + assert.equal(result.url, expected); + assert.equal(result.changed, true); + }); +} + +test("Adjust universal link keeps adj_t (tracker token on *.adj.st)", () => { + const input = "https://abc.adj.st/path?adj_t=xyz&adj_campaign=ignored-on-link"; + const result = cleanUrl(input); + assert.equal(result.url, "https://abc.adj.st/path?adj_t=xyz"); + assert.ok(result.removedParameters.includes("adj_campaign")); + assert.ok(!result.removedParameters.includes("adj_t")); +}); + +test("Iterable camelCase campaignId is not stripped (custom key, not Iterable integration name)", () => { + const input = "https://shop.example/p?iterableCampaignId=12345&sku=hat"; + const result = cleanUrl(input); + assert.equal(result.url, input); + assert.equal(result.changed, false); +}); + +test("case-insensitive match for ref_src on X", () => { + const result = cleanUrl("https://twitter.com/i/status/1?REF_SRC=twsrc%5Etfw"); + assert.equal(result.url, "https://twitter.com/i/status/1"); + assert.ok(result.removedParameters.some((p) => p.toLowerCase() === "ref_src")); +}); + +for (const name of NEW_GLOBAL_TRACKERS) { + test(`removes ${name} on generic site`, () => { const url = `https://example.com/page?id=42&${name}=track123`; const result = cleanUrl(url); assert.equal(result.url, "https://example.com/page?id=42"); - assert.ok(result.removedParameters.includes(name)); - assert.equal(result.changed, true); + assert.ok(result.removedParameters.map((p) => p.toLowerCase()).includes(name)); }); } -test("functional query params stay without aggressive mode", () => { +for (const name of AGGRESSIVE_AFFILIATE) { + test(`${name} stays unless aggressive mode`, () => { + const url = `https://example.com/deals?${name}=abc&id=1`; + const plain = cleanUrl(url); + assert.equal(plain.url, url); + const aggressive = cleanUrl(url, { aggressive: true }); + assert.equal(aggressive.url, "https://example.com/deals?id=1"); + assert.ok(aggressive.removedParameters.includes(name)); + }); +} + +test("every new global tracker has a PARAMETER_EXPLANATIONS entry", () => { + for (const name of NEW_GLOBAL_TRACKERS) { + assert.ok(Object.hasOwn(PARAMETER_EXPLANATIONS, name), `missing explanation for ${name}`); + } + for (const name of AGGRESSIVE_AFFILIATE) { + assert.ok(Object.hasOwn(PARAMETER_EXPLANATIONS, name), `missing explanation for ${name}`); + } +}); + +test("functional params stay (including ref vs ref_src)", () => { const cases = [ "https://example.com/search?q=hello&lang=en&page=2&id=9", "https://shop.example/item?ref=homepage", "https://app.example/auth?session=abc123&token=def456", - "https://wiki.example/wiki/Topic?action=edit" + "https://wiki.example/wiki/Topic?action=edit", + "https://docs.example.com/guide?ref=navigation", + "https://abc.adj.st/deeplink?adj_t=token123" ]; for (const input of cases) { const result = cleanUrl(input); From 51a56f0bfb2a6fa3cb16593429475dc6e2a17af5 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 24 Oct 2026 11:41:38 +0000 Subject: [PATCH 3/3] chore(#29): defer ref_src/ref_url and HubSpot cookies to PR #23 Remove ref_src, ref_url, __hstc, __hssc, and __hsfp from this PR so #23 can own host-scoped X tags and HubSpot cross-domain params. Keep __hssrc. Co-authored-by: Andromeda --- cleaner.js | 2 +- explanations.js | 5 ---- tests/tracking-parameters-additions.test.js | 26 +++++---------------- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/cleaner.js b/cleaner.js index b50b824..1345ea7 100644 --- a/cleaner.js +++ b/cleaner.js @@ -14,7 +14,7 @@ export const TRACKING_PARAMETERS = new Set([ "pk_campaign", "pk_kwd", "pk_source", "pk_medium", "pk_content", "pk_cid", "adobe_mc", "adobe_mc_sdid", "icid", "tt_medium", "tt_content", "adj_campaign", "adj_adgroup", "adj_creative", - "__hstc", "__hssc", "__hsfp", "__hssrc", "ref_src", "ref_url", + "__hssrc", "iterable_campaign", "iterable_template", "__iterable_campaign_id", "__iterable_template_id", "_iterable_campaign_id", "_iterable_template_id" diff --git a/explanations.js b/explanations.js index 4591b78..3b00643 100644 --- a/explanations.js +++ b/explanations.js @@ -90,12 +90,7 @@ export const PARAMETER_EXPLANATIONS = { adj_campaign: "Adjust campaign label on destination URLs (not the adj.st link token).", adj_adgroup: "Adjust ad group label on destination URLs.", adj_creative: "Adjust creative label on destination URLs.", - __hstc: "HubSpot visitor tracking cookie value appended as a cross-domain link parameter.", - __hssc: "HubSpot session tracking cookie value appended as a cross-domain link parameter.", - __hsfp: "HubSpot fingerprint cookie value appended as a cross-domain link parameter.", __hssrc: "HubSpot session-reset flag appended when HubSpot rotates session cookies.", - ref_src: "X (Twitter) embed or share referrer source tag (distinct from generic ref).", - ref_url: "X (Twitter) embed or share referrer URL tag.", iterable_campaign: "Iterable Shopify integration campaign id query parameter.", iterable_template: "Iterable Shopify integration template id query parameter.", __iterable_campaign_id: "Iterable cart-attribution campaign id (Shopify integration).", diff --git a/tests/tracking-parameters-additions.test.js b/tests/tracking-parameters-additions.test.js index a7d0fa6..f7e1d5e 100644 --- a/tests/tracking-parameters-additions.test.js +++ b/tests/tracking-parameters-additions.test.js @@ -12,12 +12,7 @@ const NEW_GLOBAL_TRACKERS = [ "adj_campaign", "adj_adgroup", "adj_creative", - "__hstc", - "__hssc", - "__hsfp", "__hssrc", - "ref_src", - "ref_url", "iterable_campaign", "iterable_template", "__iterable_campaign_id", @@ -40,15 +35,10 @@ const REALISTIC = [ expected: "https://www.adobe.com/creativecloud.html?promoid=XYZ" }, { - name: "HubSpot cross-domain", - input: "https://www.example.com/pricing?__hstc=1.abc&__hssc=1.abc&__hsfp=999&plan=pro", + name: "HubSpot __hssrc", + input: "https://www.example.com/pricing?__hssrc=1&plan=pro", expected: "https://www.example.com/pricing?plan=pro" }, - { - name: "X embed ref tags", - input: "https://x.com/jack/status/20?ref_src=twsrc%5Etfw&ref_url=https%3A%2F%2Fexample.com", - expected: "https://x.com/jack/status/20" - }, { name: "Iterable Shopify params", input: "https://shop.example/products/hat?iterable_campaign=12345&iterable_template=67890&color=blue", @@ -89,12 +79,6 @@ test("Iterable camelCase campaignId is not stripped (custom key, not Iterable in assert.equal(result.changed, false); }); -test("case-insensitive match for ref_src on X", () => { - const result = cleanUrl("https://twitter.com/i/status/1?REF_SRC=twsrc%5Etfw"); - assert.equal(result.url, "https://twitter.com/i/status/1"); - assert.ok(result.removedParameters.some((p) => p.toLowerCase() === "ref_src")); -}); - for (const name of NEW_GLOBAL_TRACKERS) { test(`removes ${name} on generic site`, () => { const url = `https://example.com/page?id=42&${name}=track123`; @@ -124,14 +108,16 @@ test("every new global tracker has a PARAMETER_EXPLANATIONS entry", () => { } }); -test("functional params stay (including ref vs ref_src)", () => { +test("functional params stay (ref, adj_t, and params owned by PR #23 stay on this branch)", () => { const cases = [ "https://example.com/search?q=hello&lang=en&page=2&id=9", "https://shop.example/item?ref=homepage", "https://app.example/auth?session=abc123&token=def456", "https://wiki.example/wiki/Topic?action=edit", "https://docs.example.com/guide?ref=navigation", - "https://abc.adj.st/deeplink?adj_t=token123" + "https://abc.adj.st/deeplink?adj_t=token123", + "https://x.com/jack/status/20?ref_src=twsrc%5Etfw&ref_url=https%3A%2F%2Fexample.com", + "https://www.example.com/pricing?__hstc=1.abc&__hssc=1.abc&__hsfp=999&plan=pro" ]; for (const input of cases) { const result = cleanUrl(input);