---
title: "Clean Tracking Link action for ActionClip"
canonical_url: "https://actionclip.app/actions/clean-tracking-link"
document_type: "standalone_action"
official: true
action_count: 1
catalog_schema_version: 1
catalog_revision: "2026-08-21.1"
catalog_published_at: "2026-08-20T18:50:00Z"
---

# Clean Tracking Link action for ActionClip

Remove common marketing trackers from a selected URL.

## What it does

Removes UTM parameters and well-known click identifiers while preserving unrelated query parameters, their encoding, and the URL fragment.

## Action details

| Field | Value |
| --- | --- |
| Category | Conversions & Utilities |
| Action type | JavaScript |
| Result | Replace or copy text |
| Internet | Not required |

## Action and outcome

| Action | Outcome |
| --- | --- |
| **Clean Tracking Link** — Selected text: https://example.com/article?id=42&utm_source=newsletter&fbclid=abc#notes | https://example.com/article?id=42#notes |

## How to remove common marketing trackers from a selected URL with ActionClip

1. Select the text you want to use.
2. Choose **Clean Tracking Link** from ActionClip.
3. Review the result, then replace the selection or copy the new text.

## Requirements

No setup required.

## Privacy

Runs locally in ActionClip’s JavaScript sandbox. Selected text does not leave your Mac.

## Action configuration

````javascript
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] || "");
}
````

## Links

- [HTML listing](https://actionclip.app/actions/clean-tracking-link)
- [Download action definition](https://actionclip.app/actions/clean-tracking-link.actionclip)
- [Browse Conversions & Utilities actions](https://actionclip.app/marketplace#marketplace-conversions)
- [All Marketplace listings](https://actionclip.app/marketplace)
