---
id: "brand/tracking/tracking-overview"
type: "doc"
url: "https://affitor.com/docs/brand/tracking/tracking-overview"
kind: "concept"
updated: "2026-11-08"
---
# Tracking Overview

> How Affitor links a partner click, your customer's signup and the sale into one attribution chain, step by step from referral link to commission.

Affitor tracking links three events into one attribution chain:

- **click**: a visitor arrives through an affiliate link
- **signup/lead**: you identify the customer after registration
- **sale**: revenue is recorded through Server-side tracking or Stripe integration

---

## The Core Model

Every successful integration follows the same three-step shape:

1. A tracked affiliate visit creates a click/customer relationship.
2. Signup tracking attaches your internal user ID to that relationship.
3. Sale tracking records revenue against the same customer/partner relationship.

Identifier consistency matters more than any single code snippet.

---

## The Tracking Flow

<Mermaid chart={`sequenceDiagram
  participant P as Partner
  participant C as Customer
  participant Y as Your site
  participant S as Stripe
  participant A as Affitor
  P->>C: Shares referral link (?via=CODE or ?aff=CODE)
  C->>Y: Visits, the SDK stores the click
  C->>Y: Signs up, lead event with the click ID
  alt Stripe integration (Stripe connected)
    C->>S: Pays through your Stripe Checkout
    S->>A: Payment event, through Stripe Connect
  else Server-side tracking
    C->>Y: Pays
    Y->>A: POST /api/v1/track/sale
  end
  A->>A: Attributes the sale, creates the commission
  A->>P: Commission appears (pending, then approved)
`} />

<Flow>
  <FlowStep>Partner shares link</FlowStep>
  <FlowStep>Customer clicks</FlowStep>
  <FlowStep>Tracker stores `affitor_click_id`</FlowStep>
  <FlowStep>Customer signs up</FlowStep>
  <FlowStep>Your internal customer ID sent to Affitor</FlowStep>
  <FlowStep>Customer pays</FlowStep>
  <FlowStep>Server-side tracking or Stripe metadata path</FlowStep>
  <FlowStep>**Revenue attributed**</FlowStep>
</Flow>

---

## From Click to Commission

### 1. Partner shares a referral link

A partner promotes your product with a referral URL such as:

```text
https://yoursite.com?via=PARTNER123
```

Programs created from October 16, 2026 (UTC) use `?via=` unless you pick `?aff=` in **Partner link parameter** under **Program settings** › **Tracking**; older programs keep `?aff=`.

### 2. Click tracking

Install the tracker so affiliate visits are detected automatically:

- Detects `?via=` or `?aff=` (`aff` wins when a URL has both)
- Records the click and stores `affitor_click_id` in a first-party cookie
- Links the visit to the correct partner/program, the initial relationship Affitor needs for attribution

Guide: [Click Tracking](/docs/brand/tracking/click-tracking/)

### 3. Signup tracking

Send your internal customer/user identifier after signup succeeds.

- browser helper: `signup(customerKey, email)`
- server API: `POST /api/v1/track/lead` with `click_id` and `customer_key`

By default a browser `signup()` records a provisional lead, which does not bind your identifier to the customer record for later sale matching (the Lead tracking section shows "Browser leads: server/payment confirmation required"). Send the same lead from your server with your API key (`POST /api/v1/track/lead` with `click_id` and `customer_key`) so the identifier is stored for later matching.

Reuse that same identifier as `customer_key` in server-side tracking and as `affitor_customer_key` in Stripe metadata.

Guide: [Lead Tracking](/docs/brand/tracking/lead-tracking-signup/)

### 4. Sale tracking

Choose one supported revenue path:

| Path | Use when |
|------|----------|
| **Server-side tracking** | your backend controls revenue events |
| **Stripe integration** | you already use Stripe Checkout / Stripe integration |

With server-side tracking, your backend calls `POST /api/v1/track/sale` when payment succeeds. For a real server-side sale, `customer_key` matches a key already stored on a customer in your program, for example by a server-verified lead or an attributed Stripe payment. If the key has not been stored, send a matching `click_id`; otherwise the request returns `400 Customer not found`.

With the Stripe integration, you keep charging in your own Stripe account and attach Affitor metadata.

Guide: [Stripe](/docs/brand/tracking/payment-tracking-stripe/), for both paths

### 5. Affitor attributes the sale

Affitor must be able to resolve the customer of a server-side sale via `customer_key` or `click_id`. A Stripe payment goes through a lookup order, from the click in the metadata to the customer key: [how Affitor resolves attribution from Stripe](/docs/brand/tracking/payment-tracking-stripe#how-affitor-resolves-attribution-from-stripe).

### 6. Commission and platform records are created

After attribution and payment-admission checks pass, Affitor records the sale. Commission creation can be held when the payment cannot be priced. Eligible commissions follow the program's hold and approval rules; test, self-referral and other held commissions have separate rules. See the [cash-flow guide](/docs/brand/quickstart/commission-approval-cash-flow) for approval, invoice funding and withdrawal conditions.

How you are billed for it: [Pricing](/docs/getting-started/pricing-performance-model).

---

## Recommended Identifier Mapping

| Context | Field |
|--------|-------|
| Signup helper | `customerKey` |
| Lead API | `customer_key` |
| Server-side tracking | `customer_key` |
| Stripe metadata | `affitor_customer_key` |
| Browser click cookie | `affitor_click_id` |
| Server-side tracking click field | `click_id` |

Use one stable internal customer ID everywhere.

---

## Attribution Basics

### Default model

Defaults:
- first-party cookie tracking
- **the first partner's click keeps the customer**: a later click from another partner in the same browser is logged but does not take the customer over
- **attribution window**: 60 days per program by default, one setting. The click must be at most that many days older than the customer's signup (or their first payment, when no signup was recorded). It is checked once, at the first attributed payment; renewals are not re-checked. The same number is the cookie lifetime.

See [Attribution Mechanics](/docs/api-reference/attribution/) for details.

### Why the signup step matters

The click cookie is reliable, but the internal customer ID is what keeps attribution working across later payment events, especially when payment happens after signup or on a backend-controlled path.

---

## One-Time vs Subscription Payments

### One-time payment

Choose either:
- Send a server-side tracking event (POST /api/v1/track/sale) after payment succeeds.
- Attach Stripe metadata for Stripe integration.

### Subscription payment

If you use Stripe subscriptions:
- Include metadata on the checkout session.
- Include the same metadata on `subscription_data.metadata`.

On your own Checkout Session, put the click in `subscription_data.metadata` so it reaches the invoices. Without a click in invoice metadata, Affitor can still match an existing customer or use a valid Affitor `client_reference_id` from the subscription's Checkout Session, subject to account and program checks.

---

## What Most Teams Choose

### Fastest path for Stripe Checkout teams (manual)

1. install tracker
2. send the lead from your backend with `POST /api/v1/track/lead` and your program API key (a browser-only `signup()` lead stays provisional by default)
3. attach Stripe metadata for payment + subscription flows

### Fastest path for custom backend teams (manual)

1. install tracker
2. send the lead from your backend with `POST /api/v1/track/lead` and your program API key
3. send `POST /api/v1/track/sale` from your backend

---

## Related Guides

1. [3-Step Integration Guide](/docs/brand/tracking/quickstart-integration/)
2. [Click Tracking](/docs/brand/tracking/click-tracking/)
3. [Lead Tracking](/docs/brand/tracking/lead-tracking-signup/)
4. [Stripe](/docs/brand/tracking/payment-tracking-stripe/)
5. [Testing Integration](/docs/brand/tracking/testing-integration/)
