Skip to Content

Track sales

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.

View as Markdown

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

1
Partner shares link
2
Customer clicks
3
Tracker stores affitor_click_id
4
Customer signs up
5
Your internal customer ID sent to Affitor
6
Customer pays
7
Server-side tracking or Stripe metadata path
8
Revenue attributed

From Click to Commission

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

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

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

4. Sale tracking

Choose one supported revenue path:

PathUse when
Server-side trackingyour backend controls revenue events
Stripe integrationyou 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, 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.

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 for approval, invoice funding and withdrawal conditions.

How you are billed for it: Pricing.


ContextField
Signup helpercustomerKey
Lead APIcustomer_key
Server-side trackingcustomer_key
Stripe metadataaffitor_customer_key
Browser click cookieaffitor_click_id
Server-side tracking click fieldclick_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 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

  1. 3-Step Integration Guide
  2. Click Tracking
  3. Lead Tracking
  4. Stripe
  5. Testing Integration