skills/marketing-growth/affiliate-program/SKILL.md
Track affiliate sales with unique links, manage commission tiers, automate payouts, and detect fraudulent referrals to protect your margins
npx skillsauth add finsilabs/awesome-ecommerce-skills affiliate-programInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
An affiliate program pays partners a commission for each sale they refer, making it a performance-based acquisition channel with no upfront media cost. The right setup depends on your platform — most merchants get 90% of the value from a dedicated app without writing any code. Custom commission rules, fraud detection, and automated payouts are where custom development adds value.
| Platform | Recommended Tool | Why | |----------|-----------------|-----| | Shopify | Refersion or UpPromote (Shopify App Store) | Native Shopify integration, automatic coupon + link generation, built-in fraud detection, PayPal/Stripe payouts | | WooCommerce | AffiliateWP ($149/yr) or Solid Affiliate | Deep WooCommerce integration, per-product commission rates, real-time reporting, Stripe payout add-on | | BigCommerce | Refersion or Goaffpro (BigCommerce App Marketplace) | Native checkout integration, multi-tier commissions, real-time dashboards | | Custom / Headless | Rewardful (SaaS, $49/mo) or build custom with Stripe Connect | Rewardful handles tracking, fraud detection, and payouts; use custom code only for complex commission logic |
Using Refersion (recommended):
yourstore.com?rfsn=XXXXX) and injects a tracking pixel at checkout — no code requiredUsing UpPromote (free plan available):
Using AffiliateWP:
yoursite.com/affiliate-area/Tier automation with WooCommerce hooks:
// In functions.php — promote affiliate to Silver tier when monthly revenue > $5k
add_action('affwp_update_affiliate', function($affiliate_id) {
$month_revenue = affwp_get_affiliate_earnings($affiliate_id, true); // current month
if ($month_revenue >= 5000 && affwp_get_affiliate_rate($affiliate_id) < 0.12) {
affwp_update_affiliate(['affiliate_id' => $affiliate_id, 'rate' => '12']);
}
});
For headless storefronts, use Rewardful (SaaS) to avoid building tracking infrastructure from scratch:
rewardful('convert', { email: order.customerEmail });
If you need custom commission logic that Rewardful cannot handle, build the tracking layer:
// Track affiliate click and set cookie
export async function trackAffiliateClick(req: Request, res: Response) {
const code = req.query.aff as string;
const affiliate = await db.affiliates.findByCode(code);
if (!affiliate) return res.redirect('/');
await db.affiliateClicks.create({
affiliateId: affiliate.id,
ip: req.ip,
clickedAt: new Date(),
});
res.cookie('aff', affiliate.id, {
maxAge: 30 * 86400 * 1000, // 30-day cookie
httpOnly: true,
secure: true,
sameSite: 'lax',
});
return res.redirect(req.query.redirect as string ?? '/');
}
// Attribute order and calculate commission
async function attributeOrderToAffiliate(orderId: string, affiliateCookieId: string) {
const order = await db.orders.findById(orderId);
const affiliate = await db.affiliates.findById(affiliateCookieId);
if (!affiliate) return;
// Fraud check: flag self-referrals
if (order.customerEmail === affiliate.email) {
await db.affiliateConversions.create({ orderId, affiliateId: affiliate.id, status: 'flagged' });
return;
}
const commissionRate = { bronze: 0.10, silver: 0.12, gold: 0.15 }[affiliate.tier];
const commission = (order.subtotalCents / 100) * commissionRate;
await db.affiliateConversions.create({
orderId,
affiliateId: affiliate.id,
commissionAmount: commission,
status: 'pending', // hold for 30-day refund window
});
}
Use Stripe Connect for payouts — it handles KYC, tax forms, and international transfers:
const transfer = await stripe.transfers.create({
amount: Math.round(totalCommission * 100),
currency: 'usd',
destination: affiliate.stripeConnectAccountId,
description: `Affiliate commission — ${month}`,
});
Regardless of platform, configure these settings in your affiliate app:
Track these metrics in your affiliate app's dashboard:
| Metric | Target | Where to Find | |--------|--------|---------------| | Click-to-conversion rate | 2–5% | Refersion: Reports → Conversions. AffiliateWP: Reports tab | | Average commission payout | Track vs. ROAS | Affiliate app → Payout reports | | Fraud rate (flagged conversions) | < 2% | Check flagged/pending queue monthly | | Top 10 affiliates by revenue | — | Affiliate app → Leaderboard |
| Problem | Solution |
|---------|----------|
| Self-referral fraud | Enable self-referral blocking in your affiliate app settings; most dedicated apps include this |
| Commission calculated on full order total including tax and shipping | Configure the commission base to use subtotal in app settings |
| Payout fails for affiliates who haven't completed KYC | Gate payouts on completed onboarding; use Stripe Connect's charges_enabled status check |
| Tier not downgrading when affiliate volume drops | Review tier assignments monthly; most apps support manual tier adjustments |
| High refund rate from one affiliate | Pause the affiliate and review recent orders; if pattern continues, terminate partnership |
tools
Let shoppers save products to a wishlist, share it with friends, and get notified when saved items come back in stock or drop in price
development
Build a themeable storefront with design tokens and CSS custom properties that supports white-labeling, multi-brand variants, and dark mode
development
Speed up product discovery with instant search suggestions, fuzzy typo matching, and category-aware results powered by Algolia or Elasticsearch
development
Build a mobile-first storefront with thumb-friendly navigation, sticky add-to-cart buttons, and touch-optimized components for high mobile conversion