Affiliate programs are one of the most efficient growth channels for SaaS and digital products. You pay for results, not impressions. Your existing users become your sales force. When done right, an affiliate system can generate 20 to 40% of your revenue at a fraction of the cost of paid advertising.
But building one is more complex than most founders expect. The tracking has to be bulletproof. The commission logic has to handle edge cases. The payouts have to be reliable. And fraud prevention has to be baked in from day one, because affiliates will find every loophole you leave open.
We have built affiliate and referral systems for multiple products. This post covers the architecture, the decisions you need to make, and the pitfalls that catch most teams off guard.
The Core Architecture
An affiliate system has four fundamental components: tracking, attribution, commission calculation, and payouts. Each one has meaningful complexity.
Tracking starts with a unique referral identifier for each affiliate. This is typically a code or link parameter that gets attached to the visitor when they arrive. The critical decision is how you persist this tracking. Cookie based tracking is the simplest but breaks when users switch devices, clear cookies, or use privacy browsers. Server side tracking with a combination of cookies and UTM parameters is more resilient. For maximum accuracy, require affiliates to use unique links and store the referral source on the user record at the moment of signup.
In our experience, the most reliable approach is to capture the referral identifier at registration and store it permanently on the user record. This survives cookie expiration, device switches, and browser privacy features. It also makes attribution auditable, which matters when affiliates dispute their commissions.
Attribution windows define how long after a click the affiliate gets credit. Industry standard is 30 to 90 days for SaaS. Shorter windows favor you financially but reduce affiliate motivation. Longer windows are more generous but increase your liability. We typically recommend 60 days as a starting point, with the ability to adjust based on your sales cycle length.
Commission Models
The commission model is where your business strategy meets your engineering. There are several common models, and each has different implementation complexity.
Flat rate per signup. The simplest model. An affiliate gets $25 for every paying customer they refer. Easy to implement, easy to understand, but it does not align incentives with customer lifetime value. An affiliate gets the same commission for a customer who churns in month one as for one who stays for three years.
Percentage of first payment. The affiliate earns a percentage (typically 20 to 30%) of the referred customer's first payment. Better alignment than flat rate, and it automatically scales with your pricing tiers. A customer who signs up for your enterprise plan generates a larger commission than one on your starter plan.
Recurring commission. The affiliate earns a percentage of every payment the referred customer makes, typically for 12 to 24 months or for the lifetime of the customer. This is the most attractive model for affiliates and creates the strongest alignment with long term value. It is also the most complex to implement because you need to track ongoing payments, handle refunds and chargebacks, and manage commission expiration.
Tiered commissions. Rates increase as affiliates drive more volume. For example, 20% for the first 10 customers, 25% for 11 to 50, 30% for 50 and above. This incentivizes your top performers to push harder. Implementation requires tracking cumulative referrals per affiliate per period and recalculating rates dynamically.
For most SaaS products, we recommend starting with percentage of first payment because it balances simplicity with alignment. You can add recurring commissions later as the program matures. Our experience building subscription billing systems directly informs how we structure these commission calculations to handle upgrades, downgrades, and cancellations cleanly.
The Payout Workflow
Commission payouts sound simple until you start building them. Here are the decisions and edge cases.
Minimum payout threshold. Set a minimum (usually $50 to $100) before an affiliate can withdraw. This reduces your transaction costs and discourages low quality affiliates who generate one or two signups and disappear. Store accumulated earnings and only create a payout when the threshold is met.
Payout frequency. Monthly is standard. Some programs offer weekly payouts for high volume affiliates. Whatever you choose, build a clear payout schedule and communicate it. Nothing damages affiliate trust faster than unpredictable payments.
Payout methods. PayPal and bank transfer (ACH/wire) cover the vast majority of affiliates. For international affiliates, consider services like Wise or Payoneer. We covered the broader landscape of payment processing in a separate post, and much of that applies here.
Holdback period. This is critical. Do not pay commissions the moment a customer signs up. Hold commissions for 30 to 60 days to account for refunds, chargebacks, and fraud. If a referred customer gets a refund in week two, the affiliate commission should be reversed before it is paid out. Without a holdback period, you are paying commissions on revenue you no longer have.
Tax compliance. In the United States, you need to collect W 9 forms from affiliates earning over $600 per year and issue 1099s. International affiliates may require W 8BEN forms. Build this into your onboarding flow. Do not make it an afterthought.
Fraud Prevention
Affiliate fraud is a when, not an if. The most common patterns we see:
Self referrals. Affiliates create fake accounts using their own links to earn commissions. Prevent this by comparing affiliate email domains to referred user emails, flagging signups from the same IP address, and requiring payment verification before commissions are credited.
Cookie stuffing. Affiliates inject their referral cookies onto user browsers without a real click, through hidden iframes or redirects. Server side tracking and click validation (requiring a real page load from your referral link) mitigate this.
Incentivized signups. Affiliates pay people to sign up through their links using cashback offers. These users churn immediately. Your holdback period catches most of this, but also monitor for affiliates with abnormally high churn rates on their referrals.
Bot traffic. Automated signups to generate commissions. CAPTCHAs, email verification, and payment verification are your primary defenses.
Build a fraud scoring system that flags affiliates based on multiple signals: referral to conversion ratio, churn rate of referred users, geographic patterns, signup velocity, and IP clustering. You do not need machine learning for this. Rule based flagging with manual review handles it well at most scales.
Build vs. Buy
Should you build a custom affiliate system or use a platform like FirstPromoter, Rewardful, or PartnerStack?
For most products under $5M ARR, starting with an off the shelf solution makes sense. The tracking, dashboard, and payout infrastructure are handled for you. The tradeoff is limited customization and platform fees (typically 5 to 10% of commissions paid, on top of the commissions themselves).
If your affiliate program is a core growth channel, or if you need custom commission logic that off the shelf tools do not support, building custom is worth the investment. The tracking and attribution are the hardest parts. The dashboard and payout logic are straightforward full stack development work.
We typically recommend starting with a third party tool to validate the channel, then migrating to a custom build once the program generates enough revenue to justify the investment. This is consistent with our general philosophy on build versus buy decisions.
Getting Started
If you are planning an affiliate program, start with these steps:
1. Define your commission model. Pick one model, keep it simple, and document it clearly.
2. Build or integrate tracking. Referral link generation, click tracking, and attribution storage.
3. Create the affiliate dashboard. Affiliates need to see their clicks, conversions, earnings, and payout history.
4. Set up payout infrastructure. Holdback periods, minimum thresholds, and payment method support.
5. Implement fraud detection. At minimum, self referral blocking and churn rate monitoring.
Each of these is a well defined engineering problem. The complexity is in the details and edge cases, not the concept.
If you are building a product and want to add an affiliate channel, get in touch. We can help you design the system, build it, or integrate a third party solution that fits your stage and budget.