# UTM & Click-ID Redirect Audit (`natstandridge/campaign-redirect-audit`) Actor

Find the exact redirect hop that drops or changes UTM, GCLID and other campaign parameters. Inspect restored values, duplicate parameters and terminal HTTP status. One completed URL audit per result.

- **URL**: https://apify.com/natstandridge/campaign-redirect-audit.md
- **Developed by:** [Nathaniel Standridge](https://apify.com/natstandridge) (community)
- **Categories:** Marketing, SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 90.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 completed campaign url audits

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## UTM & Click-ID Redirect Audit

Find the exact HTTP redirect that drops or changes a campaign parameter. Built
for PPC teams, marketing agencies and website maintainers checking campaign
links before launches or after redirect/CMS changes.

Give it your campaign URLs and receive one report per completed check: every
HTTP hop, the final status and destination, changed parameter values, and the
first hop where a value was removed or altered. If a later redirect restores a
value, the earlier problem remains visible.

The Actor checks `utm_*`, `gad_*`, `gclid`, `dclid`, `gbraid`, `wbraid`, `fbclid`,
`msclkid`, `ttclid` and `_gl` automatically. You can add custom parameter names or
require particular fields at the input. No extra API key, proxy or browser setup
is needed.

### Try the two-URL demo

The two examples use Postman Echo. The first redirect keeps the UTM value and
click ID. The second sends the request to a page without either parameter. A
completed check costs $0.001, so both examples together cost **$0.002**.
[Postman Echo](https://learning.postman.com/docs/developer/echo-api/)

```json
{
  "urls": [
    "https://postman-echo.com/redirect-to?url=https%3A%2F%2Fpostman-echo.com%2Fget%3Futm_source%3Dqa%26gclid%3DTesTER-123&status_code=302&utm_source=qa&gclid=TesTER-123",
    "https://postman-echo.com/redirect-to?url=https%3A%2F%2Fpostman-echo.com%2Fget&status_code=302&utm_source=qa&gclid=TesTER-123"
  ],
  "maxUrls": 10,
  "maxRedirects": 8,
  "requestTimeoutSeconds": 20,
  "maxRunSeconds": 120
}
```

Click **Start**, then inspect the **Campaign URL audits** output. The first row
should say `parameters_preserved`. The second should say `issues_found`, with
`firstProblemHop: 1` and `lostParameters: ["gclid", "utm_source"]`. The full
**hop evidence** view contains the before/after values and redirect URLs.

This trimmed result is from the live diagnostic demo verified on November 22, 2026. The output views expose the full rows and redirect evidence.

```json
{
  "finalUrl": "https://postman-echo.com/get",
  "finalStatus": 200,
  "checkComplete": true,
  "verdict": "issues_found",
  "parametersPreserved": false,
  "finalParametersMatchInput": false,
  "firstProblemHop": 1,
  "lostParameters": ["gclid", "utm_source"],
  "changedParameters": [],
  "restoredParameters": [],
  "parameterChanges": [
    {
      "parameter": "gclid",
      "hop": 1,
      "kind": "removed",
      "beforeValues": ["TesTER-123"],
      "afterValues": []
    },
    {
      "parameter": "utm_source",
      "hop": 1,
      "kind": "removed",
      "beforeValues": ["qa"],
      "afterValues": []
    }
  ]
}
```

### A useful recurring workflow

1. Export active landing-page URLs from your campaign spreadsheet or ad tool.
2. Pass them in `urls`. Optionally set `requiredParameters` to
   `["utm_source", "utm_medium", "utm_campaign"]` for manually tagged campaigns.
3. Filter `verdict = issues_found`. Use each `parameterChanges[].hop` to find the
   responsible `hops` transition and forward the diagnostic through your own
   ticketing or automation workflow.
4. Recheck after the fix. Configure an Apify Schedule yourself if you want
   repeated checks after launches or deployments.

For an untagged landing page, you may manually append a recognizable test value
such as `gclid=TesTER-123`. Google documents this procedure in its
[missing Google Ads data guide](https://support.google.com/analytics/answer/13367418?hl=en).
The Actor never inserts test parameters automatically. Google also explains why
[losing click identifiers during redirects](https://support.google.com/analytics/answer/15629968?hl=en)
can affect measurement. This Actor reports observed HTTP behavior; it cannot
establish whether analytics code executed or a conversion was attributed.

### Inputs and limits

| Field | Default | Meaning |
| --- | --- | --- |
| `urls` | Two diagnostic URLs in the form | Array of 1–1,000 entries; HTTP or HTTPS, public DNS host, standard port, no embedded username/password. Up to 4,096 characters and 128 query fields per URL. |
| `parameterNames` | `[]` | Up to 20 additional, exact case-sensitive names. Built-in campaign names remain included. |
| `requiredParameters` | `[]` | Up to 20 names that must already be present and nonempty in the original URL. Missing/blank input fields are separate findings from redirect loss. |
| `maxUrls` | `100` | Maximum unique valid URLs to attempt, from 1 to 500. Excess inputs are reported as input-limited, not silently counted as checked. |
| `maxRedirects` | `8` | From 0 to 15 HTTP redirect hops. |
| `requestTimeoutSeconds` | `20` | From 3 to 30 seconds for a whole URL check, including robots, DNS, TLS and redirects. |
| `maxRunSeconds` | `120` | From 30 to 180 seconds of work; collection reserves 25 seconds for delivery. Storage cleanup has a separate short bound. |

URLs are processed serially with bounded robots caching. Standard ports, host
case and fragments are normalized for deduplication; paths, query order, query
name case and values remain significant. Identical normalized URLs are checked
and billed only once per run. Query values are URL-decoded once; equivalent
`%20` and `+` space encodings compare equally, while value case, duplicate values
and their order are retained. The result plan is bounded to approximately 8 MB;
large reports stop with `output_size_limit` and keep their incomplete status.

### Reading the output correctly

| Field | Meaning |
| --- | --- |
| `verdict` | Overall result: `parameters_preserved`, `issues_found`, or `no_tracking_parameters`. Use this with `findings` for triage. |
| `parametersPreserved` | Whether observed tracked values survived every HTTP redirect unchanged. Can be `true` alongside an HTTP 404, HTTPS downgrade or missing required input. `null` when no tracking parameter was observed. |
| `finalParametersMatchInput` | Whether the original tracked names/ordered values match the final URL. Can be `true` even when an intermediate hop lost or changed them. `null` if none were present at input. |
| `firstProblemHop` | First redirect transition with a tracked parameter removed/changed, numbered from 1. Does not represent missing-at-input, HTTP status, or other findings. |
| `lostParameters`, `changedParameters` | Names removed/changed at any observed redirect transition, even if later restored. |
| `missingAtFinal`, `changedAtFinal` | Original tracked names missing/changed at the final URL. |
| `restoredParameters` | Original values changed/lost during the chain but restored at the final URL. |
| `parameterChanges` | Every added/removed/changed tracked parameter, with hop and before/after ordered value arrays. |
| `hops` | Initial response is hop 0. A change at hop 1 belongs to the transition from `hops[0].url` to `hops[0].nextUrl`. |
| `checkComplete` | A supported terminal HTTP response was obtained. It does not mean a healthy page, a browser audit, or successful attribution. |

The separate `OUTPUT` record contains attempted/completed/delivered counts,
duplicates, incomplete checks, limits and free diagnostics. `complete: false`
means some requested work or delivery remains incomplete. Inspect it even when
the run's platform status is `SUCCEEDED`.

### Price and charging

**$0.001 per delivered completed URL audit — $1 per 1,000.** One charge includes
the whole redirect chain and all parameter findings. No start event or second
per-hop charge is configured. Apify platform usage for this PPE Actor is included
in the displayed event price.

A completed check with parameter loss, a terminal 404, or another terminal HTTP
error is a useful diagnostic and is charged. Invalid URLs, DNS/TLS failures,
timeouts, unsafe destinations, robots denial/unavailability, redirect loops or
limits, unresolved redirects and HTTP 401/403/407/429 responses are incomplete;
they appear in `OUTPUT` and are **not charged**. Duplicate inputs and summary
records are not charged.

Set the run's maximum cost to bound spending. The Actor stops source collection
when it has completed as many audits as the remaining event budget can buy, and
checks the budget again before delivery. A frozen plan and pending-write
checkpoint prevent replay of uncertain dataset appends on resume. If a write's
outcome cannot be reconciled, the run stops visibly instead of risking a duplicate
charge. A new, separate run is a new check and may be charged again.

### Coverage and limitations

- HTTP 301, 302, 303, 307 and 308 redirects are followed. JavaScript,
  meta-refresh, consent flows, browser cookies and analytics tags are not run.
- Results describe this HTTP client and network at the observation time.
  Geographic redirects, bot protection or a real browser may behave differently.
  HTTP 401/403/407/429 is left incomplete rather than called a successful audit.
- `robots.txt` is respected at each destination. Unavailable or unsupported
  robots responses stop the check. Wildcard `*`, end-anchor `$` and longest-rule
  precedence are supported by the pinned Protego parser. No CAPTCHA/login bypass
  or automatic website request retries are used.
- Public unicast DNS addresses are validated and pinned at every HTTP request.
  Private, reserved, multicast and transition destinations, IP literals and
  nonstandard ports are refused. TLS certificate verification remains enabled.
- Only fixed request headers are sent. Operator credentials, arbitrary custom
  headers and cookies are never forwarded to target websites.
- Checks do not prove revenue loss, guaranteed attribution, inbox/delivery
  behavior, or Google Ads compliance. A missing value is evidence of a redirect
  change, not a measurement of business impact.
- URLs and parameter values are stored in your run output. Supply diagnostic or
  public campaign URLs, not credentials, signed private links or customer data.

### Local verification

```sh
uv sync --frozen --group dev
.venv/bin/python -B -m unittest discover -s tests -v
.venv/bin/python -B tools/local_smoke.py
```

Tests cover parameter semantics, hard deadlines, public-destination checks,
robots, bounded collection, exact-price enforcement, capped billing, resume and
lost-response cases through the pinned Apify client. No test sale is evidence of
customer demand. Open an Actor issue with the expected/observed behavior and a
run link if you find a problem; remove private parameter values first.

# Actor input Schema

## `urls` (type: `array`):

Public HTTP(S) URLs to audit. The demo contains a controlled preserving redirect and a dropping redirect on postman-echo.com. Duplicate normalized URLs are checked once. Invalid entries are uncharged diagnostics in OUTPUT.

## `parameterNames` (type: `array`):

Exact, case-sensitive custom names. utm\_*, gad\_*, gclid, dclid, gbraid, wbraid, fbclid, msclkid, ttclid and \_gl are included automatically.

## `requiredParameters` (type: `array`):

Optional names that must already be present and nonempty in the original URL. Missing-at-input findings are distinguished from loss during redirects. No synthetic parameters are added.

## `maxUrls` (type: `integer`):

Excess unique valid inputs are reported as input-limited; they are not charged.

## `maxRedirects` (type: `integer`):

Redirect loops, missing destinations and limits produce uncharged incomplete diagnostics.

## `requestTimeoutSeconds` (type: `integer`):

Hard wall-clock limit including robots, DNS, TLS and every redirect.

## `maxRunSeconds` (type: `integer`):

Collection stops 25 seconds before this bound to reserve delivery time. Storage cleanup has a separate short bound.

## Actor input object example

```json
{
  "urls": [
    "https://postman-echo.com/redirect-to?url=https%3A%2F%2Fpostman-echo.com%2Fget%3Futm_source%3Dqa%26gclid%3DTesTER-123&status_code=302&utm_source=qa&gclid=TesTER-123",
    "https://postman-echo.com/redirect-to?url=https%3A%2F%2Fpostman-echo.com%2Fget&status_code=302&utm_source=qa&gclid=TesTER-123"
  ],
  "parameterNames": [],
  "requiredParameters": [],
  "maxUrls": 100,
  "maxRedirects": 8,
  "requestTimeoutSeconds": 20,
  "maxRunSeconds": 120
}
```

# Actor output Schema

## `audits` (type: `string`):

No description

## `summary` (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 = {
    "urls": [
        "https://postman-echo.com/redirect-to?url=https%3A%2F%2Fpostman-echo.com%2Fget%3Futm_source%3Dqa%26gclid%3DTesTER-123&status_code=302&utm_source=qa&gclid=TesTER-123",
        "https://postman-echo.com/redirect-to?url=https%3A%2F%2Fpostman-echo.com%2Fget&status_code=302&utm_source=qa&gclid=TesTER-123"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("natstandridge/campaign-redirect-audit").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 = { "urls": [
        "https://postman-echo.com/redirect-to?url=https%3A%2F%2Fpostman-echo.com%2Fget%3Futm_source%3Dqa%26gclid%3DTesTER-123&status_code=302&utm_source=qa&gclid=TesTER-123",
        "https://postman-echo.com/redirect-to?url=https%3A%2F%2Fpostman-echo.com%2Fget&status_code=302&utm_source=qa&gclid=TesTER-123",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("natstandridge/campaign-redirect-audit").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 '{
  "urls": [
    "https://postman-echo.com/redirect-to?url=https%3A%2F%2Fpostman-echo.com%2Fget%3Futm_source%3Dqa%26gclid%3DTesTER-123&status_code=302&utm_source=qa&gclid=TesTER-123",
    "https://postman-echo.com/redirect-to?url=https%3A%2F%2Fpostman-echo.com%2Fget&status_code=302&utm_source=qa&gclid=TesTER-123"
  ]
}' |
apify call natstandridge/campaign-redirect-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,natstandridge/campaign-redirect-audit"
        }
    }
}
```

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/wIeksRnI888Qpjd2M/builds/HwCACUdM6lNhLuhOV/openapi.json
