# Attribution

Attribution is the process of linking a user's conversion (swap, deposit, mint, etc.) back to the referrer who brought them in. When a referred user converts, Fuul's attribution system determines which referrer gets credit — and rewards.

## How attribution works

1. **User clicks a referral link** — A pageview event is recorded with the referrer's information
2. **User connects their wallet** — The tracking session is linked to the user's identity
3. **User performs a qualifying action** — The trigger fires and the system looks up who referred this user
4. **Attribution is made** — The referrer is credited and a payout is calculated

{% hint style="info" %}
Users can also accept a referral code directly (without clicking a link), which immediately establishes the referrer relationship for all future conversions.
{% endhint %}

## Attribution settings

Attribution behavior is configured per project at **Settings > Payouts & Attribution**. Two settings control how credit is assigned:

### Attribution window

The number of days during which a referrer can receive credit for a conversion.

| Setting                  | Description                                                                             |
| ------------------------ | --------------------------------------------------------------------------------------- |
| **Default: 10,000 days** | Effectively lifetime — the referrer gets credit as long as the user eventually converts |
| **Custom window**        | Set a shorter window (e.g., 30 days) to only credit recent referrals                    |

### Attribution type

Determines which referrer gets credit when a user has been referred by multiple people.

| Type                      | Who gets credit                            | Example                                                                  |
| ------------------------- | ------------------------------------------ | ------------------------------------------------------------------------ |
| **First Click** (default) | The very first referrer within the window  | Day 1: Referrer A, Day 3: Referrer B, Day 5: conversion → **Referrer A** |
| **Last Click**            | The most recent referrer before conversion | Same scenario → **Referrer B**                                           |

### Lifetime attribution

When enabled (recommended for most programs), all future conversions from a referred user are attributed to their original referrer — the one credited with the initial conversion.

| Setting               | Behavior                                                                                            |
| --------------------- | --------------------------------------------------------------------------------------------------- |
| **Enabled** (default) | Once attributed, the relationship is permanent. All future conversions go to the original referrer. |
| **Disabled**          | Each conversion is evaluated independently using the attribution window and type.                   |

{% hint style="success" %}
Lifetime attribution is enabled in the vast majority of programs. It ensures referrers get ongoing credit for the users they bring in, which is the strongest incentive for long-term referral partnerships.
{% endhint %}

## Referral tracking

To track referrals, projects need to integrate the [Fuul Web SDK](/developer-guide/getting-started-with-fuul-web-sdk.md) to capture pageview and wallet connection events. Learn more in the [Tracking Referrals](/developer-guide/tracking-referrals-in-your-app.md) developer guide.

## Self-referral prevention

Fuul prevents affiliates from referring themselves. If a user's identifier matches their referrer's identifier, the attribution is rejected.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fuul.xyz/core-concepts/referrals-and-attribution.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
