> ## Documentation Index
> Fetch the complete documentation index at: https://docs.davazmysel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# URL mappings

> Define where each tracked URL redirects and how it's labeled, with exact paths or glob patterns.

Mappings live under **Mappings** in the dashboard. What a mapping does depends on the domain's [redirect mode](/domains/redirect-modes):

* **Mode C (Custom redirects):** the mapping controls the redirect destination and the attribution labels.
* **Modes A, B, and D:** the mapping is a label only — it names a URL for analytics, but doesn't change where it redirects.

## Create a mapping

<Steps>
  <Step title="Add the URL">
    On the **Mapped** tab click **Add URL**, or click **Create mapping** next to an unmapped URL the dashboard has already seen.
  </Step>

  <Step title="Choose the match type">
    On Mode C domains, pick **Exact** or **Glob**.
  </Step>

  <Step title="Set destination and labels">
    Enter the destination URL (Mode C) and the campaign labels (source, medium, campaign) to record for matching visits.
  </Step>
</Steps>

## Pattern syntax

### Exact

A literal path: `/spring-sale` matches only `/spring-sale`.

### Glob

| Token   | Matches                         | Example                                             |
| ------- | ------------------------------- | --------------------------------------------------- |
| `*`     | One path segment                | `/email/*` matches `/email/promo`, not `/email/a/b` |
| `**`    | Any depth                       | `/blog/**` matches `/blog/2026/05/article`          |
| `:name` | One segment, captured for reuse | `/email/:campaign_id` captures `campaign_id`        |

### Template placeholders

Glob destinations can reuse what was matched:

| Placeholder | Inserts                                      |
| ----------- | -------------------------------------------- |
| `{name}`    | The value captured by `:name` in the pattern |
| `{utm_*}`   | All UTM parameters from the inbound URL      |
| `{query}`   | The full inbound query string                |

```text Capture and forward theme={null}
Pattern:      /email/:campaign_id
Destination:  https://shop.com/land?cid={campaign_id}&{utm_*}

/email/summer26?utm_source=fb  →  https://shop.com/land?cid=summer26&utm_source=fb
```

## Match precedence

When several mappings could match the same URL:

1. **Exact mappings always win** over glob patterns.
2. Among globs, the **most specific** pattern wins: literal segments beat `:name` captures, which beat `*`, which beats `**`.
3. On an exact tie, the **mapping created first** wins.

If nothing matches, the visitor goes to the domain's **default redirect URL** (set on the domain's Configuration tab). If no default is configured, the request fails.

## Matching is forgiving

* Case-insensitive: `/Spring-Sale` matches `/spring-sale`.
* Trailing slashes are ignored: `/ref/` and `/ref` match the same rule.
* URLs are decoded before matching, and query parameter order doesn't matter.

Use [Test a URL](/domains/test-a-url) to check which mapping wins for any given URL.
