Affiliate tracking for SaaS startups: a minimum viable setup
Start with one clear rule: only a defined, verified business event should create an eligible commission. A referral link click is a lead signal, not proof of revenue. A signup may create a trial, but a trial does not necessarily become a paying customer. For a SaaS startup, the core tracking path is affiliate ID → referral token → application account → billing customer → subscription → successful payment → commission.
You do not need an elaborate partner network to launch. You do need consent-aware attribution, reliable billing event processing, a refund policy, payout approval and a way to reconcile commissions. This guide explains the event contract and acceptance tests rather than ranking vendors by unverified performance.
Define the referral and billing event contract
| Event | Identifier to keep | Commission treatment |
|---|---|---|
| Affiliate link opened | Affiliate ID, referral token, timestamp, consent state | Do not pay |
| User registers | Internal account ID and referral association | Usually pending attribution only |
| Trial begins | Trial ID or subscription ID, expected billing date | No cash commission unless contract says otherwise |
| Invoice or transaction paid | Payment event ID, customer ID, subscription ID, currency and net amount | Evaluate eligible commission |
| Renewal paid | Unique invoice or transaction ID | Calculate renewal commission if policy allows |
| Refund or chargeback | Adjustment ID and original payment ID | Reverse or reduce relevant commission |
Use immutable event IDs and explicit state transitions. A webhook retry must update an existing record or be ignored, not create a second commission. Keep financial calculations in a durable ledger, not in a browser cookie.
Capture referrals without breaking consent rules
Give each affiliate a unique link or code. When a visitor lands, record only the referral information permitted by your privacy and consent design. If consent is required for a particular cookie or storage method, do not bypass that requirement for attribution. Associate the referral with an authenticated account when a signup occurs, and document how long attribution lasts and whether first-touch or last-touch wins.
For users who switch devices, a browser cookie alone cannot reliably prove identity. An authenticated account association or other explicitly permitted server-side mapping can preserve attribution after signup. Do not attempt hidden fingerprinting or collect sensitive personal information merely to increase attribution coverage. For trade-offs, see our cookie versus server-side tracking guide.
Connect Stripe Billing or Paddle Billing correctly
For Stripe subscriptions, subscribe to relevant billing webhook events and verify incoming signatures. Stripe's subscription documentation emphasizes that status changes and payments are asynchronous. Treat a checkout completion event as one signal, then reconcile the actual invoice and payment state before issuing commissions. Handle failed payments, subscription cancellation and plan changes as separate cases.
For Paddle Billing, Paddle documents that custom_data on a transaction can be copied to the resulting subscription and later renewal transactions. Use that mechanism only as allowed by the affiliate vendor's documented integration. Do not assume every Paddle Classic integration works with Paddle Billing. FirstPromoter has a Paddle Billing-specific guide, including required notifications and webhook secret configuration.
For more complex systems, combine an affiliate tracking API with a webhook integration and a scheduled reconciliation job. The API handles backfills and exports; webhooks handle timely events; your ledger makes the result auditable.
A commission ledger that survives retries
Store a commission row keyed to the original eligible payment ID and affiliate program rule. Useful fields include affiliate ID, customer ID, subscription ID, source invoice, currency, eligible base amount, rate, calculated commission, approval state, adjustment references and payout batch ID. Make the combination of source payment and program rule unique so duplicate notifications cannot generate duplicate commissions.
Example: a $50 monthly subscription with a 25% commission generates $12.50 after an eligible settled payment. If the same invoice event arrives twice, the ledger should still show one $12.50 entry. If a full refund later occurs, the ledger should show a linked negative adjustment rather than silently deleting the original commission. If the contract limits commission to six paid months, the seventh invoice should not generate another commission.
Prevent avoidable attribution and payout abuse
Write down rules for self-referrals, duplicate accounts, prohibited paid-search bidding, coupon leakage and incentivized signups. Use approval delays when refunds are common. Flag unusual conversion patterns for review rather than automatically labeling a partner fraudulent. Make the appeal and dispute process visible in your affiliate terms.
Never expose secret billing keys or partner payout credentials in browser JavaScript. Validate webhook signatures, use least-privilege API credentials, rotate compromised secrets and avoid logging full payment or customer details. For additional controls, see affiliate fraud detection.
Sandbox acceptance tests before launch
- Test a clean referred visit and a signup with the intended attribution window.
- Test an existing customer visiting a new affiliate link to verify your overwrite policy.
- Complete a paid first invoice and verify one correct commission.
- Retry the same webhook; verify there is still only one commission.
- Pay a renewal and test a commission term limit.
- Cancel before renewal; verify no unearned commission appears.
- Issue a partial refund and a full refund in separate tests; verify linked adjustments.
- Test two currencies, failed payment, partner suspension and export/reconciliation.
Record expected versus actual results, invoice IDs, event timestamps and responsible owner. Do not move from sandbox to live payouts until the tests pass.
A 30-day startup rollout
Week 1: Define the program's ideal partners, payout terms, attribution rules and commission policy. Week 2: Connect the billing provider, build the ledger and run sandbox QA. Week 3: Invite a small number of relevant partners, review onboarding and observe event reconciliation. Week 4: Audit referral-to-paid conversion, approved commissions, refund adjustments and payout readiness.
Measure referred paying customers, activation, retained revenue, commission as a share of gross margin and partner support workload. A small cohort may be too early for reliable lifetime-value conclusions, so do not promise an immediate return on investment.
Frequently asked questions
Can I pay affiliates when a trial starts?
You can design a lead-based reward if your agreement allows it, but that is different from a commission on collected subscription revenue. Make the event definition explicit and protect against duplicate or low-quality signups.
Do I need server-side tracking?
You need trustworthy server-side confirmation of payment and commission eligibility. Browser-side referral collection can be part of the system, but it should not be the sole authority for financial payouts.
Can a webhook be delivered more than once?
Yes. Design for retries and out-of-order events. Use unique event identifiers, idempotent processing and a scheduled reconciliation path.
Official references and editorial notes
Documentation checked 26 October 2026. This is a practical implementation framework, not a claim that SaaSAlways deployed or tested a particular integration. Review privacy obligations and current vendor documentation before launch; see our methodology.
Related: recurring commission tracking, Paddle Billing affiliate tools and affiliate software costs.