Skip to content
Back to Growth & Acquisition

Referral Tracking & Attribution

Instrument the full referral funnel with unique codes, attribution windows, and per-channel tracking so you know what actually works.

Why

Without per-inviter unique codes and an attribution window, you cannot compute k, cost/acq, or fraud rate — you are running a referral program blind. The attribution window (30-90 day cookie) determines whether late-converting invites get credited to the inviter; too short and inviters stop seeing rewards for invites that did convert, too long and you pay for organic signups that would have happened anyway. Per-channel tracking (email vs Slack vs Twitter vs copy-paste-link) tells you which distribution channel drives the highest-quality invites, so you can double down on the channel that works and kill the ones that don't. The tracking must be built before the program launches, not bolted on after — retrofitting attribution onto a live program is expensive and the historical data is lost.

When

Before the program launches. Build tracking first, then incentives, then the UI — never the reverse.

How

1. Generate a unique referral code per user at signup (e.g. ref=abc123), stored on the user record
2. Build the referral link: yoursite.com/?ref=abc123, with the code in a 90-day cookie on first visit
3. On signup, check the cookie: if ref is present and the new user's email != inviter's email, attribute the signup to that inviter
4. Define the attribution window: 90 days for B2B (long sales cycle), 30 for consumer; last-touch wins within the window
5. Track the full funnel per invite: sent → opened → clicked → signup → activated → paid; store each event with timestamp
6. Add per-channel tracking: the invite's distribution channel (email, Slack, Twitter, copy-paste) is logged when the link is generated
7. Build a dashboard: k, i, c, cost/acq, fraud rate, per-channel breakdown, per-cohort trend — the growth team's referral source of truth
8. Reconcile weekly: sum of attributed signups should match the reward payouts; any gap is a tracking bug or fraud

Example

# Referral tracking schema (per invite event)
{
  invite_id: "inv_abc123",
  inviter_id: "user_456",
  channel: "slack",           // email | slack | twitter | copy_paste
  sent_at: "2026-10-05T14:00Z",
  opened_at: "2026-10-05T14:02Z",
  clicked_at: "2026-10-05T14:03Z",
  signup_at: "2026-10-05T14:05Z",
  activated_at: "2026-10-06T09:00Z",
  paid_at: null,
  attribution_window: "90d",
  reward_status: "fulfilled"  // pending | fulfilled | fraud_held
}

# Per-channel breakdown (this week)
Slack:      400 invites, k=0.52, c=0.34, cost/acq=$12  ← double down
Email:      300 invites, k=0.31, c=0.18, cost/acq=$22
Twitter:    200 invites, k=0.22, c=0.11, cost/acq=$38
Copy-paste: 150 invites, k=0.41, c=0.28, cost/acq=$14
# Slack + copy-paste drive 62% of attributed signups at the best economics

Common Problems

  • ⚠No attribution window, so inviters don't get credited for invites that convert on day 31 and they stop inviting.
  • ⚠First-touch attribution when the recipient also clicked an ad, so the ad gets credit and the referral program looks unprofitable.
  • ⚠No per-channel tracking, so you can't tell that Slack invites convert 3x email invites and you keep spending on email.
  • ⚠Building the program first and the tracking second, so the first month of data is unattributed and unrecoverable.

Best Practices

  • ✓Build the tracking before the program launches; retrofitting attribution onto a live program loses the first month of data permanently.
  • ✓Use a 30-90 day attribution window with last-touch-wins; too short demotivates inviters, too long credits organic signups.
  • ✓Track per-channel so you can double down on the channel that drives the highest-quality invites; blended numbers hide 3x differences.
  • ✓Reconcile attributed signups against reward payouts weekly; any gap is a tracking bug or fraud, and both need immediate attention.