Overview
What Clean Tracking Link does
Removes UTM parameters and well-known click identifiers while preserving unrelated query parameters, their encoding, and the URL fragment.
| Category | Conversions & Utilities |
|---|---|
| Action type | JavaScript |
| Result | Replace or copy text |
| Internet | Not required |
Example
Action and outcome
| Action | Outcome |
|---|---|
| Clean Tracking LinkSelected text: https://example.com/article?id=42&utm_source=newsletter&fbclid=abc#notes | https://example.com/article?id=42#notes |
Workflow
Use Clean Tracking Link
Follow these steps to remove common marketing trackers from a selected URL with ActionClip.
- Select the text you want to use.
- Choose Clean Tracking Link from ActionClip.
- Review the result, then replace the selection or copy the new text.
Before you add it
Requirements and privacy
- Before you start: No setup required.
- Your selected text: Runs locally in ActionClip’s JavaScript sandbox. Selected text does not leave your Mac.
Inspect before installing
Action configuration
The definition below is included so you can inspect how the action works before downloading it.
JavaScript definition
function run(selected_text) {
const input = selected_text.trim();
const match = input.match(/^(https?):\/\/([^/?#\s]+)([^?#]*)(\?[^#]*)?(#.*)?$/i);
if (!match) throw new Error("Select one complete HTTP or HTTPS URL.");
const blocked = new Set([
"fbclid", "gclid", "dclid", "msclkid", "mc_cid", "mc_eid", "igshid",
"vero_id", "_hsenc", "_hsmi", "mkt_tok", "oly_anon_id", "oly_enc_id"
]);
const query = (match[4] || "").replace(/^\?/, "");
const kept = query ? query.split("&").filter((entry) => {
if (!entry) return false;
const rawKey = entry.split("=", 1)[0].replace(/\+/g, " ");
let key;
try { key = decodeURIComponent(rawKey).toLowerCase(); }
catch (_) { key = rawKey.toLowerCase(); }
return !key.startsWith("utm_") && !blocked.has(key);
}) : [];
return match[1].toLowerCase() + "://" + match[2] + (match[3] || "")
+ (kept.length ? "?" + kept.join("&") : "") + (match[5] || "");
}