# URL Tracking Parameter Remover - UTM Cleanup and Evidence (`variable_mitts/tracking-query-url-cleaner`) Actor

Remove selected tracking parameters from supplied URLs. Protect chosen product-variant and signed URL fields and inspect resulting collisions.

- **URL**: https://apify.com/variable_mitts/tracking-query-url-cleaner.md
- **Developed by:** [Dhan sites](https://apify.com/variable_mitts) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.48 / 1,000 input record processeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## URL Tracking Parameter Remover - UTM Cleanup and Evidence

Remove selected tracking query parameters while preserving product variants, query order and fragments. Protect named parameters and review collisions between cleaned URLs without dropping source records.

### Start with this workflow

Remove tracking noise without silently dropping meaningful URL variants.

**After the run:** Inspect clean_url, protected parameters and collision groups in REPORT. Review signed URLs before use; this does not establish global URL equivalence.

**What is billed:** Processed supplied records, including per-record diagnostics; invalid top-level input is free. Check the Pricing tab for the applicable subscription-tier rate. Result rows and billable input units can differ. A successful execution does not guarantee full coverage.

The example uses a small supplied fixture or the publisher-owned demonstration target. Replace it with input you are authorized to process; inspect coverage, diagnostics and limits before downstream use.

### Quick start

1. Open the Input tab or the public Example task and restore the example input.
2. Run the small example below. Use non-sensitive supplied records first. Source URLs are metadata; this Actor does not fetch websites.
3. Open the dataset for individual results, then read `REPORT` for coverage and diagnostics. A successful execution alone does not establish that all requested work was completed.
4. Download the relevant files from the Output tab, or retrieve the dataset through Apify's API for your next workflow step.

```json
{
  "records": [
    "https://shop.example/p?utm_source=news&variant=2&currency=INR",
    "https://shop.example/p?variant=2&currency=INR",
    "https://shop.example/p?variant=3"
  ]
}
```

### Output example

The following is a real first result from the developer's example run; some large nested fields are omitted for readability. These are supplied sample records; source labels are not independently verified website evidence.

```json
{
  "record_index": 0,
  "valid": true,
  "clean_url": "https://shop.example/p?variant=2&currency=INR",
  "removed_parameters": [
    "utm_source"
  ],
  "error": "",
  "original_url": "https://shop.example/p?utm_source=news&variant=2&currency=INR",
  "protected_parameters": [],
  "same_clean_url_indices": [
    0,
    1
  ]
}
```

The default dataset contains result rows. Files declared for this Actor are listed below; availability depends on the input mode and validation result. Input errors and diagnostics are reported in REPORT.

- `REPORT`

### Input reference

| Field | Type | Required | Description |
|---|---|---|---|
| `maxRecords` | integer | No | Total record processing cap. Capped output is explicitly truncated. |
| `records` | array | Yes | JSON array of input records. Up to10000 supplied; at most1000 processed per run. |
| `removeParameters` | array | No | Omit to remove common utm fields and click IDs. Supply \[] to remove none. Matching is case-sensitive. |
| `preserveParameters` | array | No | Exact decoded parameter names to keep even when selected for removal. Case-sensitive; encoded values/order remain unchanged. |

### Advanced workflow

#### Protected parameters and collision reconciliation

preserveParameters optionally protects parameter names even if they are also listed for removal. Matching is exact and case-sensitive after name decoding; retained query components preserve their original encoding and order. Results list protected_parameters, and REPORT includes collision_groups plus removal/collision counts. Groups describe only inspected input records; no source records are dropped and no global URL equivalence is inferred. Review signed URLs before rewriting them.

### Pricing

$0.6 per 1,000 processed records ($0.0006 each) at the entry tier. Per-record diagnostics count as processed records; invalid top-level input has no record event fee. No run-start event or automatic output-row event. The Pricing tab shows the applicable subscription-tier price. The spending limit can reduce the number of processed items.

For example, 100 billable items cost $0.06 in Actor event fees at the entry tier. Zero findings is different from zero processed items. Inspect the report's processed/checked counts and the run's charge events to reconcile a run.

### Limits and interpretation

Default 200, maximum 1,000 processed records; at most 10,000 supplied records and 2 million serialized JSON characters. No URL fetching, redirect resolution or global URL-equivalence inference. Parameter matching is case-sensitive after name decoding. Review signed URLs before rewriting. Collision groups only describe the inspected sample.

Results cover only the inspected input. Truncation and unchecked records require review; do not treat them as a complete-source guarantee. Input is not overwritten. The Actor uses limited permissions.

### Troubleshooting and support

- **Run succeeded but output is diagnostic:** inspect `REPORT`, correct the named fields, and rerun. Handled invalid input can finish with `SUCCEEDED` and no billable items.
- **Fewer results than requested:** check coverage, truncation, spending limits and the limits above. Check the input field names, per-record diagnostics and coverage. This tool does not fetch websites.
- **Repeat a workflow:** save a task with your input and use Apify scheduling or its API. Review each run's coverage before passing results downstream.
- **Report a problem:** open this Actor's Issues tab with the run ID, expected behavior and a minimal non-sensitive input. Never post tokens, credentials or private source data.

### Related tools

- [rag dataset cleaner evidence](https://apify.com/variable_mitts/rag-dataset-cleaner-evidence)
- [dataset contract field checker](https://apify.com/variable_mitts/dataset-contract-field-checker)

### Who is this for?

Data teams cleaning URL lists for deduplication or reporting. Supply URLs and choose which parameters must remain significant.

### Frequently asked questions

#### Will removing UTM parameters preserve every signed URL?

Not automatically. Review the protected-parameter settings before processing signed URLs or product variants. Collision groups are review evidence, not proof that two URLs are equivalent. URLs are not fetched.

#### How do I try it before using my full input?

Open the Input tab, review the prefilled example, and run a small batch with a spending limit. Inspect the dataset and report before increasing the batch. Examples can incur the documented inspection or analysis fee; an execution marked successful can still contain rejected records or incomplete coverage.

#### Can I use the Actor through an API or on a schedule?

Yes. Use Apify's [Actor API](https://docs.apify.com/api/v2/acts-run-sync-get-dataset-items-post) or [schedules](https://docs.apify.com/platform/schedules). Keep credentials private and use the documented input fields. The pricing and limits below apply to API runs too.

### Related tools for the next step

- [Broken Internal Link Checker - Source Pages and Repair CSV](https://apify.com/variable_mitts/internal-link-source-checker)
- [RAG Dataset Cleaner - Text Deduplication and Source URLs](https://apify.com/variable_mitts/rag-dataset-cleaner-evidence)

# Actor input Schema

## `maxRecords` (type: `integer`):

Total record processing cap. Capped output is explicitly truncated.

## `records` (type: `array`):

JSON array of input records. Up to10000 supplied; at most1000 processed per run.

## `removeParameters` (type: `array`):

Omit to remove common utm fields and click IDs. Supply \[] to remove none. Matching is case-sensitive.

## `preserveParameters` (type: `array`):

Exact decoded parameter names to keep even when selected for removal. Case-sensitive; encoded values/order remain unchanged.

## Actor input object example

```json
{
  "maxRecords": 200,
  "records": [
    "https://shop.example/p?utm_source=news&variant=2&currency=INR",
    "https://shop.example/p?variant=2&currency=INR",
    "https://shop.example/p?variant=3"
  ]
}
```

# Actor output Schema

## `startHere` (type: `string`):

No description

## `report` (type: `string`):

No description

## `rows` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "records": [
        "https://shop.example/p?utm_source=news&variant=2&currency=INR",
        "https://shop.example/p?variant=2&currency=INR",
        "https://shop.example/p?variant=3"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("variable_mitts/tracking-query-url-cleaner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "records": [
        "https://shop.example/p?utm_source=news&variant=2&currency=INR",
        "https://shop.example/p?variant=2&currency=INR",
        "https://shop.example/p?variant=3",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("variable_mitts/tracking-query-url-cleaner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "records": [
    "https://shop.example/p?utm_source=news&variant=2&currency=INR",
    "https://shop.example/p?variant=2&currency=INR",
    "https://shop.example/p?variant=3"
  ]
}' |
apify call variable_mitts/tracking-query-url-cleaner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,variable_mitts/tracking-query-url-cleaner"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/iybdeoqVNBCBizbGL/builds/kGED9JjvP4Nvw1rtl/openapi.json
