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

# Traffic sources

> Capture ad click IDs, prices, and campaign parameters from incoming traffic.

A traffic source tells Metricanic how to read data in an incoming tracking URL. Use it to preserve the source's click ID, record visit cost, and compare placements, creatives, or other source parameters in reports.

Each campaign selects one traffic source. Several campaigns can reuse the same source when they use the same parameter mapping. Create separate source records when those mappings need to differ.

## Understand the parameter handoff

The source expands its macros before sending a visitor. Metricanic reads the resulting query parameters and stores the values for attribution and reporting.

For example:

```text theme={null}
Generated link:  https://trk.example.com/CAMPAIGN_ID?extid={clickid}&creative={creative_id}
Actual arrival:  https://trk.example.com/CAMPAIGN_ID?extid=ad-123&creative=banner-a
Stored values:   External ID = ad-123, Token 1 = banner-a
```

The source macro names above are illustrative. Use the exact macros supported by your traffic source.

The configuration table separates four concepts:

| Column | Meaning                                                            | Example         |
| ------ | ------------------------------------------------------------------ | --------------- |
| Slot   | Metricanic's storage field                                         | Token 1         |
| Alias  | A readable name for a custom token                                 | Creative        |
| Param  | Query parameter Metricanic reads                                   | `creative`      |
| Macro  | Value or source placeholder inserted into generated tracking links | `{creative_id}` |

**Click ID** and **Cost** are fixed system rows. The 15 token slots store additional parameters. Naming Token 1 `Creative` does not change its stable outgoing macro, `{token1}`.

## Create a source

1. Open **Traffic sources** and click **Create**.
2. Choose a template if one matches your provider, or **Custom** to configure the mapping yourself.
3. Enter **Name**.
4. In **Parameters**, fill the rows the source will actually send. For **Click ID**, choose a distinct Param such as `extid` and the source's click ID macro.
5. Configure **Cost** if the source supplies a price per visit. The campaign must use **Visit cost** → **auto** to record it.
6. Add useful tokens such as creative, placement, or source campaign ID. Save the source and select it in your campaign.

A template is a starting configuration. Check its parameters against the source's current setup before launching.

A generated tracking link includes a row only when both **Param** and **Macro** are filled. A Param without a Macro can still receive manually supplied data, but the link generator will not add it. You can also use a fixed Macro value for a controlled test or campaign label.

## Preserve the source click ID

The **Click ID** row stores the source's identifier as **External ID**. Its Metricanic macro is `{external_id}`.

Metricanic's own `{click_id}` is generated separately and passed to the offer for conversion attribution. Returning the source's click ID in an incoming Metricanic event URL will not establish that attribution. Read [URL macros](/tracking/url-macros) for both directions of the exchange.

Use distinct, consistently spelled Param names. Avoid reserved tracking names such as `clickid`, `cmpid`, `vid`, `vclk`, `landing`, `page`, and `ts`. Custom token parameters allow letters, digits, underscores, and hyphens. Duplicate token parameters or aliases are rejected.

## Send conversions back to the source

**Postback URL** is the source's receiving URL for an outgoing conversion notification. It is different from the incoming callback that an affiliate network sends to Metricanic.

The campaign editor can seed an event's outgoing postback from the selected traffic source. Review **2. Events** → **Outgoing postback** in each campaign to confirm the destination and whether sending is enabled. Include `{external_id}` when the source needs its original click identifier.

Follow [outgoing postbacks](/conversions/postbacks) to configure and test this step.

## Verify with a real arrival

Copy the saved campaign's tracking instructions. For a manual test, replace source placeholders with known values such as `extid=test-ad-001`, `cost=0.20`, and `creative=banner-a`.

Open the URL and inspect the campaign report using **External ID** and the relevant token. If a token contains literal braces, the source did not expand the macro. If it is blank, compare the actual query parameter with its configured Param, including case.

Editing a shared traffic source updates the parsing configuration used by its campaigns. It does not rewrite URLs already entered in an ad platform. After changing parameter names or source macros, recopy the affected campaign links and test again.
