Attribution

Attribution

How Traaaction permanently links a customer to their seller, and why this attribution never changes.

01

The principle: first-click attribution

The first seller who brings a visitor gets credited. This attribution never changes, even if the visitor clicks another affiliate link later.

It's the fairest model: whoever introduces the product gets rewarded.

This model is used by the largest affiliate platforms.

02

How the seller ↔ customer link is created

  1. 1The customer signs up on the startup's website
  2. 2The Click ID is sent to Traaaction via the tracking script or API
  3. 3Traaaction finds the seller associated with this Click ID
  4. 4The customer is then permanently linked to this seller

Webhook priority: session.metadata.tracClickId → client_reference_id → Customer table lookup. For renewals (invoice.paid), attribution uses the Customer table directly.

03

Linking data

  • Click IDwhich click brought this customer
  • Tracked linkwhich link was shared
  • Sellerwho gets credited for this customer
  • Customer IDwho is this customer (unique ID on the startup's side)

These 4 data points are locked at creation and never modified afterwards.

The Customer record

external_id = Stripe customer ID, linked to link_id and affiliate_id. Once set, these fields are never overwritten — ensuring permanent first-click attribution.

04

Lifetime attribution

Once created, the attribution is permanent:

  • Even if the cookie expires (after 90 days)
  • Even if the customer switches browser or device
  • The attribution is stored in our database
  • Any future purchase by this customer → same seller credited
05

Real-world scenarios

Customer clicks Monday, buys Friday

→ Seller credited (active cookie)

Customer clicks in January, buys in March

→ Seller credited (90-day cookie)

Customer signs up on mobile, buys on desktop

→ Seller credited (customer ID)

Customer clicks seller A's link, then seller B's link, then buys

→ Seller A credited (first-click)

06

For subscriptions

Attribution applies to all automatic renewals.

The seller gets credited month after month as long as the subscription is active.

No cookie needed for renewals — attribution is done via customer ID.

07

Stripe webhook configuration

Attribution relies on 4 Stripe webhook events configured by the startup. Each event serves a different attribution purpose:

EventAttribution role
checkout.session.completedInitial attribution — links Click ID → Seller → Customer via metadata
invoice.paidRenewal attribution — uses existing Customer record (no Click ID needed)
charge.refundedClawback — finds commission via checkout session or invoice, then deletes
customer.subscription.deletedCancellation — deletes all PENDING commissions for the subscription

The startup must configure these 4 events in their Stripe dashboard pointing to the Traaaction webhook URL. Both payment and subscription modes use the same endpoint.

Traaaction