Traceability

Tracking

From clicking an affiliate link to automatic Stripe injection — every step explained.

01

The affiliate link

Each seller has a unique link in the format traaaction.com/s/{mission-slug}/{seller-code}.

traaaction.com/s/mission-slug/a7k2m9x5

The seller code is a unique 8-character identifier, automatically assigned to each seller.

This link points to the startup's website. When a visitor clicks, the system records the event before redirecting.

02

The Click ID

Every time someone clicks an affiliate link, a unique identifier is generated server-side.

clk_1708012345_a7k2m9x5

This Click ID connects three pieces of information: the visitor, the source seller, and the relevant mission.

Generated server-side, it's impossible to forge or guess.

Format: clk_{timestamp}_{hex} — includes a timestamp and random hex for uniqueness. Social crawlers (bots) are detected via User-Agent and redirected without setting a cookie.

03

Click ID storage

LocationDurationPurpose
Browser cookie (clk_id)90 daysRecognize the visitor if they return
URL parameter (trac_id)ImmediateTransmission to trac.js script and Stripe
Traaaction servers90 daysServer-side attribution
localStorage (fallback)PersistentBackup if cookies are blocked

Click tracking is rate-limited via Redis sliding window to prevent abuse.

04

The redirect

The redirect is instant (under 100ms). The visitor sees nothing — they land directly on the startup's website.

startup.com/pricing?trac_id=clk_a7k2m9x5&client_reference_id=clk_a7k2m9x5

The destination URL contains the Click ID as a parameter, allowing the trac.js script to retrieve it.

Social media crawlers (bots) are detected and redirected without cookie injection to avoid false clicks.

05

The trac.js script

The trac.js script is installed on the startup's website. It automatically detects the Click ID (from the URL or cookie) and saves it with dual security (cookie + localStorage).

It then scans the page to detect Stripe payment elements:

  • buy.stripe.com links
  • <stripe-buy-button> buttons
  • <stripe-pricing-table> tables
  • Custom payment forms

The Click ID is automatically injected into every detected Stripe element, with zero developer intervention.

06

Analytics data recorded

  • Source seller, mission and tracked link
  • Device type (Mobile / Desktop / Tablet)
  • Country and city
  • Traffic source (referrer)
  • Timestamp

This data is recorded in the background and has zero impact on the visitor's browsing speed.

07

Lead tracking API

For non-payment events (signups, form submissions), startups can use the Lead API to trigger LEAD commissions programmatically:

// POST /api/track/lead
{
"eventName": "signup",
"customerExternalId": "user_123",
"clickId": "clk_...",
"customerEmail": "user@example.com"
}

Authentication via x-workspace-id header. Creates a LeadEvent and attributes the customer to the seller.

08

The trac.js SDK

The trac.js SDK can be installed on the startup's website to automatically handle click tracking and Stripe injection. One script tag is all it takes:

<script
src="https://traaaction.com/trac.js"
defer
></script>
  • Auto-detects Click ID from URL parameters (trac_id) or existing cookie
  • Dual storage: cookie + localStorage for resilience against cookie blockers
  • Scans and injects Click ID into all Stripe payment elements automatically
  • SPA-compatible: monitors URL changes via History API for single-page applications

Key takeaways

  • Everything is automatic — no configuration needed from the seller
  • The cookie lasts 90 days
  • Stripe injection happens without writing a single line of code
  • Zero impact on page load speed
Traaaction