> ## 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 models

> Give conversion and revenue credit to the touches before a conversion with first touch, last touch, last non-direct, linear, position-based or time decay models.

An attribution model decides how much credit each touch gets for a conversion. ManaLens runs six rule-based models over the observed, ordered touches before each conversion.

## Models

| Model | Credit |
| - | - |
| `first_touch` | 100% to the first observed touch, including Direct |
| `last_touch` | 100% to the last observed touch, including Direct |
| `last_non_direct` (default) | 100% to the last touch that is not Direct. Direct only when every touch is Direct. |
| `linear` | Equal credit to every observed touch |
| `position_based` | 40% to the first touch, 40% to the last, and 20% split across the middle. One touch gets 100%; two touches get 50% each. |
| `time_decay` | More credit to recent touches. The default half-life is 7 days (configurable from 1 to 30 days). |

These are explicit product rules. They do not claim to match any ad platform's models.

## Where to use them

* **[Ask AI](https://docs.manalens.dev/features/ask-ai.md):** ask, for example, "Which sources get credit for `signup_completed` with the linear model?"
* **[MCP](https://docs.manalens.dev/mcp/overview.md):** the `get_attribution` tool takes the model, conversion event, grouping, dates, lookback and half-life.

## Options

| Option | Values |
| - | - |
| Conversion event | An exact custom event name, such as `purchase` or `signup_completed`, or `refund`. The goal `purchase` also counts [provider payments](https://docs.manalens.dev/features/revenue.md#provider-payments-as-events) from Stripe and Paddle; a sale is counted once |
| Group by | `channel_type`, `source`, `medium`, `campaign`, `paid_source`, `referrer`, `ref`, `click_id` |
| Lookback | Days before each conversion to scan for touches: 30 by default, 1 to 365 |
| Half-life | For `time_decay` only: 7 days by default, 1 to 30 |

## How touches are built

* A **touch** is a page view that starts a session, or a page view whose acquisition (source, medium, campaign, referrer, referral, click ID) differs from the previous page. Repeated page views with the same acquisition in one session do not add credit.
* Only touches at or before the conversion count. Each conversion's lookback starts at its own time.
* Source priority within a touch: UTM source, then paid network, then referral code, then external referrer, then Direct.
* A conversion with no touch in the lookback window is **unattributed**. The Attribution report shows it in the **(unattributed)** row. The older `GET /v0/projects/:projectId/attribution` endpoint credits the conversion's own context instead (Direct if it has no signal).
* **Identity:** the explicit `user_id` comes first. Anonymous history joins a user only when the browser links to exactly one user. A browser and a game install also join through a [link from the game](https://docs.manalens.dev/guides/identify-users.md#one-player-on-the-website-and-in-the-game), so a website touch can get credit for a purchase in the game. See [core concepts](https://docs.manalens.dev/data/concepts.md#people-and-identity-links).

## Revenue credit

Revenue is the conversion's numeric `revenue` property (or the invoice amount for provider revenue), split by the same weights as the conversion. The report uses one currency (USD by default). Other currencies are converted with the ECB rate of the conversion day (`currency_mode=only` counts the report currency alone). A conversion without a `currency` counts in the report currency. Revenue is **net**: a Stripe or Paddle refund is subtracted from the payment it refunds, in the currency of that payment and at the rate of the payment day. The refund takes revenue from the same touches with the same weights, and the conversion still counts (a full refund leaves 0 revenue). A refund counts when it is recorded by the end of the date range. A refund that does not name its payment stays in revenue (gross): a refund recorded before refunds were linked to payments, or a Stripe refund on API version 2025-03-31 or later when no read key is connected (the charge then has no invoice). The report says when the date range has such a refund.

## Filters

* **Acquisition filters** (channel, source, campaign and so on) select the **credited touches** after credit is assigned.
* **Other filters** (country, device, OS, browser, locale, page) select the **conversions**, and keep all of their earlier touches.

So a filtered total does not always add up to all conversions. A report returns the top 100 groups.

## Limits

Models measure observed click and visit paths. They do not use ad impressions, ad spend, probabilistic identity matching or causal uplift.


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