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

# Attribution

> Connect the channel, referrer, referral code, UTM campaign or ad that brought someone to your site with what they do next.

Attribution connects the source that brought someone to your site with what they do next: page views, signups, purchases and revenue. Traffic alone cannot tell you which channels bring valuable users or deserve more budget.

The Web SDK captures referrers, referral codes, UTM parameters and ad click IDs from the landing URL. The collector classifies each event into a channel. Reports then show these sources per visit, per user (first and last touch), and as conversion credit.

## Attribution sources

| Source | What it answers |
| - | - |
| **Channels** | Which category, such as Paid Search, Organic Social, AI, Email or Direct, drove the visit? |
| **Referrers** | Which external site sent the visitor? |
| **Referrals** | Which referral or partner code (`ref`) brought the visitor? |
| **Ads** | Which paid network (Google, Meta, Microsoft, TikTok, X, LinkedIn, Reddit, Snapchat) acquired the visit? |
| **UTM** | Which source, medium, campaign, content or term drove the visit? |

You see these as tabs on the [Overview](https://docs.manalens.dev/features/overview.md) acquisition card, as breakdowns on charts, and as [filters](https://docs.manalens.dev/features/filters-segments.md) on every report.

## Channels

The collector assigns one `channel_type` to each browser event when it arrives. The first matching rule wins, in this order:

1. **Paid Search**
2. **Paid Video**
3. **Paid Social**
4. **Email**
5. **Display** (ad network domain)
6. **Referrals** (a referral code from a `?ref=` link, or a [typed referral code](https://docs.manalens.dev/features/referral-codes.md))
7. **Display** (medium)
8. **Paid Search** or **Paid Social** from the click network alone
9. **Paid Other**
10. **AI** (for example, chat assistants)
11. **Organic Search**
12. **Organic Social**
13. **Organic Video**
14. **Referrers** (any other external site)
15. **Direct**

Domain lists match the referrer domain (without `www.` and `m.`) and the lower-case `utm_source`.

A **paid signal** is an ad click ID, `gad_source`, or a paid `utm_medium`: `cpc`, `cpm`, `cpv`, `cpa`, `ppc`, `paidsearch`, `paidsocial`, `sem`, `retargeting`, or any value that starts with `paid`. A paid UTM without a click ID gets the paid source `paid_utm`.

> [!NOTE]
>
> **YouTube:** `youtube.com`, `youtu.be` and `utm_source=youtube` are Organic Video, or Paid Video with a paid signal. The YouTube iOS app often sends no referrer, so tag your YouTube links with UTM parameters.

Server events have no channel. Reports show them as Direct.

## Ad click IDs

Every network's click ID is kept, even when several arrive together. A derived `click_id` holds the first valid one, in this order: `gclid`, `gbraid`, `wbraid`, `fbclid`, `msclkid`, `ttclid`, `twclid`, `li_fat_id`, `rdt_cid`, `ScCid`. `gad_source` marks Google as the source but is not a click ID. See [what we collect](https://docs.manalens.dev/data/what-we-collect.md#campaign-and-ad-parameters) for the full list.

## Campaign continuity

The SDK keeps the landing campaign in memory as the visitor moves through a single-page app, and attaches it to later `track` and `identify` calls. A new tagged landing replaces the whole campaign, so two campaigns never mix. The campaign is not written to browser storage.

## First touch and last touch

For each user, the [Users](https://docs.manalens.dev/features/users.md) page and profiles show the earliest and latest non-empty value of each field (channel, referrer, referral, ad, UTM fields, click ID) over their whole history. Use the **Any**, **First-touch** and **Last-touch** filter modes to choose which touch a filter matches.

These per-field values can come from different visits. For conversion credit from one coherent touch, use [attribution models](https://docs.manalens.dev/attribution/models.md).

## Limits

Attribution measures observed visits and clicks. It does not track ad impressions or view-through, import ad spend, or compute ROAS. Missing referrers, untagged links and cleared cookies cannot be observed. Visits on another device join only after `identify()` with the same user ID, or when your game opens the website with a handoff link.

For game installs, see [install attribution](https://docs.manalens.dev/attribution/installs.md): it links the first open of a game to a recent website visit from the same network.

> [!TIP]
>
> Tag every campaign link with UTM parameters, and [identify users](https://docs.manalens.dev/guides/identify-users.md) at signup and login, so that later visits join the first one. In a game, open your website with the Godot SDK's `link_url()`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.