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

# Attribution

> How Tolt credits a sale to the partner who sent the customer: cookie window, first bind, renewals.

acme.com/?ref=sam

&#x20;tolt.js
click
&#x20;Tolt

In the browser

**cookie**first-partytolt\_referral8537db0b…domainacme.comexpires30d

In Tolt

**click**8537db0b…partner"sam"countryUSdevicedesktopreferreryoutube.com

A visitor clicks Sam's link `acme.com/?ref=sam`. Tolt records the click and remembers it in a first-party cookie, so when that visitor signs up days later, Sam gets the credit.

## The cookie window

The cookie lives for your program's **cookie duration** (`cookie_duration`, 30 days by default). Sign the customer up inside that window and they are bound to the partner for good.

jane\@example.com ref=samClickacme.com/?ref=samDay 0Signupcus\_3VbH… LeadDay 12Expiredtolt\_referralDay 30    ![](https://mintcdn.com/tolt-29/IdZ6_r2VYMOh5a6x/images/logos/stripe.svg?fit=max\&auto=format\&n=IdZ6_r2VYMOh5a6x\&q=85\&s=ccd9514f833537cef0c31c21e9a7b355)Payment\$49.00 Month 2Day 42Commission\$14.70 For SamDay 42

The cookie expires on day 30. The binding stays.

The window only limits the first bind. What expires is the chance to attach a partner to a new customer, never the commissions on a customer who is already attributed.

## First bind wins

* **First click wins.** While a referral cookie exists, `tolt.js` ignores other referral links, so a second partner's link does not steal the visitor.
* **The customer is bound once.** Attribution is decided when the customer is created. Later clicks do not move them.
* **Renewals keep paying.** Every later payment, upgrade and renewal is credited to the same partner. Your [commission flows](/concepts/commission-flows) decide how much and for how long.

## What counts as a click

A click is a visit whose URL carries a referral parameter that matches one of your links, like `?ref=sam` or `?via=sam`. Tolt records the page, referrer, device and country.

* Returning visits while the cookie is set don't create new clicks.
* No browser? Record the click from your backend with [`POST /v2/clicks`](/tracking/server-side) and pass its `id` as `click_id` later.

`tolt.js` exposes the active referral in the browser:

```js theme={"system"}
const tracking = await window.tolt?.ready();
// {
//   click_id: "8537db0b-efeb-416c-ae68-07e6e2863a33",
//   partner_id: "part_8fKq2LmZx7RtYw3nVbHc5dPj",
//   program_id: "prg_3hTq9WxLm2RbZk7VnYc4DsPf",
//   cookie_duration: 30,
//   customer_id: null,
// }
```

It resolves to `null` when the visitor didn't arrive through a partner link.

## Three ways to attribute

| Method | How the partner is found | Use it for |
| - | - | - |
| **Link** | Click on `acme.com/?ref=sam`, then signup inside the cookie window | Blogs, newsletters, social posts |
| **Promotion code** | The customer pays with Sam's code (`SAM20`). No click needed | Podcasts, YouTube, offline |
| **Manual** | You pick the partner: dashboard, or `POST /v2/customers` with `partner_id` | Sales-led deals, support fixes |

Whichever method binds first sticks. See [promo codes](/tracking/promo-codes) and [signups](/tracking/signups) for the code.

> [!TIP]
>
> Reports credit partners with these same rules, so [`/v2/reports`](/guides/reporting) totals line up with attribution.


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