Seatext library / BotRefund evidence
Affiliate Commission Attribution Best Practices: A Step-by-Step Guide
Learn how to set up fair affiliate commission attribution. Choose the right model, configure short cookie windows, exclude organic traffic, use server‑side tracking, block coupon‑extension hijacking, and run regular audits. Follow this checklist to...
✓ Built for advertisers who need clear, refund-ready traffic evidence.
Affiliate commission attribution decides which partner receives credit for a sale. Incorrect attribution can cause you to pay commissions for traffic that would have converted organically or that was generated by bots. This guide provides a practical, checklist‑style implementation plan that covers model selection, cookie configuration, traffic exclusion, server‑side tracking, security hardening, and ongoing audit routines.
Quick Comparison of Attribution Models
| Model | How It Works | Pros | Cons | Best For |
|---|---|---|---|---|
| First‑Click | Credits the first affiliate that brought the visitor to the site. | Rewards top‑of‑funnel partners; simple to explain. | May over‑credit affiliates if the visitor returns later via another channel. | Brands that rely on awareness affiliates and want to protect downstream paid media. |
| Last‑Click | Credits the most recent affiliate click before conversion. | Aligns with many network defaults; easy to implement. | Vulnerable to coupon‑extension hijacking; can reward low‑value clicks. | Networks that enforce strict last‑click rules and have strong anti‑hijack controls. |
| Multi‑Touch (Weighted) | Distributes credit across multiple clicks using predefined weights. | Reflects the true contribution of each touchpoint; reduces incentive for click‑spam. | Requires data‑driven weighting; more complex reporting. | Large advertisers with robust analytics platforms who can afford custom weighting. |
Choose the model that matches your business goals, then follow the steps below to implement it securely.
Before You Start: Prerequisites
You need a tracking platform that can capture click timestamps, referrer URLs, and cookie IDs. Access to the checkout page is required to add server‑side code or security policies. If you run paid ads, verify that your affiliate network can differentiate organic from paid traffic.
Step 1: Choose the Right Attribution Model
Most affiliate networks default to last‑click, but first‑click or multi‑touch often yields fairer payouts. Trade‑off example: A fashion brand noticed that last‑click gave 30 % of commissions to coupon extensions that appeared only at checkout. Switching to first‑click reduced those payouts by 22 % while keeping overall conversion volume stable.
To implement first‑click, configure your platform (e.g., Impact, ShareASale, Refersion) to set a cookie on the first affiliate click and never overwrite it on subsequent clicks. For multi‑touch, define a weighting scheme such as 50 % first click, 30 % middle click, 20 % last click, and store each touch in a server‑side session.
Step 2: Set Appropriate Cookie Durations
Short cookie windows limit the chance that a returning visitor receives credit for an affiliate who only introduced the user once. Common practice is 24–48 hours for high‑velocity e‑commerce and 7 days for longer‑consideration products.
How to set custom durations:
- ShareASale: In the merchant dashboard, go to Settings → Cookie Settings** and enter the desired number of hours.
- Impact: Use the API call
PUT /affiliates/cookiewith thedurationfield set to86400(seconds) for a 24‑hour window. - Refersion: Edit the
refersion.jssnippet and changecookieExpiresto1(days) or2for 48 hours.
Test the impact on conversion rate for at least two weeks before finalizing. If you see a drop larger than 5 % in overall sales, consider a slightly longer window or a hybrid model that credits first‑click but falls back to last‑click after the window expires.
Step 3: Exclude Non‑Affiliate Traffic Channels
Organic search, direct visits, and social referrals should not generate affiliate commissions unless they contain a tracked affiliate parameter.
Implementation steps:
- Append a unique query parameter (e.g.,
aff_id=12345) to every affiliate link. - On the landing page, read the parameter and store it in a first‑party cookie named
aff_ref. - Configure your attribution engine to ignore clicks where the
referrerdomain matches known organic sources (google.com, bing.com, yahoo.com) and theaff_refcookie is absent. - For platforms that support rule‑based exclusion (e.g., Impact), create a rule: Exclude if referrer matches regex ^(https?://)?(www\.)?(google|bing|yahoo)\.
These rules prevent “last‑click hijack” by coupon extensions that fire after the user has already arrived via organic search.
Step 4: Implement Server‑Side Tracking
Server‑side (or server‑to‑server) tracking sends click data directly from your backend to the affiliate network, bypassing the browser. This eliminates cookie‑hijack and reduces bot‑generated noise.
Typical workflow:
- User clicks an affiliate link. The link points to
https://yourstore.com/track?aff_id=123. - Your server records the click (timestamp, IP, user‑agent) and returns a 302 redirect to the product page.
- When the purchase completes, your checkout backend calls the affiliate network’s conversion endpoint (e.g.,
POST https://api.impact.com/conversions) with the stored click ID.
Example Node.js snippet:
app.get('/track', (req, res) => {
const affId = req.query.aff_id;
const clickId = uuidv4();
// Store click data in Redis for 48h
redis.setex(`click:${clickId}`, 172800, JSON.stringify({affId, ip: req.ip, ua: req.headers['user-agent']}));
res.redirect(302, req.query.dest);
});
app.post('/checkout/complete', async (req, res) => {
const {orderId, clickId} = req.body;
const clickData = await redis.get(`click:${clickId}`);
if (clickData) {
await axios.post('https://api.impact.com/v1/conversions', {
click_id: clickId,
order_id: orderId,
amount: req.body.amount
});
}
res.sendStatus(200);
});
Replace the endpoint and payload format with those required by your affiliate partner. Most major networks publish API docs for this purpose.
Step 5: Block Coupon‑Extension and Bot Hijacking
Browser extensions such as Honey or Capital One Shopping inject affiliate parameters at checkout, stealing last‑click credit. Combine three defenses:
- Content Security Policy (CSP): Add a header that only allows scripts from your domain. Example:
Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.yourstore.com; object-src 'none'; frame-ancestors 'none';
- Obfuscate Coupon Field IDs: Rename the HTML ID from
#coupon_codeto a random string generated at page render, e.g.,#c_9f3a1b. Store the mapping in a hidden field so your JavaScript can still read it. - Referral Timeline Checks: Compare the timestamp of the affiliate cookie with the time the user added items to the cart. If the cookie appears after the cart is populated, flag the transaction as a possible override.
BotRefund’s blog (S1) describes how logging a coupon‑extension cookie set *after* cart completion provides evidence to deny the payout.
Step 6: Run Monthly Attribution Audits
Regular audits catch mis‑attributed commissions and emerging bot patterns. Use these metrics:
- Click‑to‑Sale Lag: Average time between first affiliate click and conversion. Outliers > 48 h may indicate organic conversion.
- Conversion Rate by Affiliate: Compare each partner’s rate to the site average. A sudden spike > 30 % above baseline warrants review.
- Refund Rate: Track refunds linked to affiliate sales. BotRefund reports an 83 % refund success rate for high‑volume advertisers (S2).
- Bot Detection Flags: Count sessions flagged by BotRefund for super‑human click speed, linear mouse paths, or data‑center IPs. Source S2 notes that 20 % of ad traffic is bots.
Audit workflow:
- Export click and conversion logs from your affiliate platform.
- Join with server‑side logs on the click ID.
- Calculate the metrics above using a spreadsheet or BI tool.
- Generate a report highlighting affiliates with high bot‑flag ratios or abnormal lag.
- Contact the affiliate to request evidence or issue a Do Not Pay (Do Not) notice.
Document every action in a shared audit folder to maintain compliance and provide evidence for refund claims.
Key Facts About Affiliate Commission Risks
| Fact | Source |
|---|---|
| Coupon extensions automatically inject affiliate parameters at checkout to capture last‑click credit. | S1 |
| 83% refund success rate for high‑volume advertisers using bot detection. | S2 |
| 20% of ad traffic is bots, consuming ad budgets. | S2 |
| Digital ad fraud is projected to cost over $100 billion globally in 2026. | S6 |
Limitations and When These Practices Do Not Apply
If your affiliate network mandates last‑click, you may need to negotiate a custom model or switch providers. Server‑side tracking requires development resources; small teams might start with a hybrid approach that uses client‑side pixels plus server verification for high‑value orders.
Shortening cookie windows can initially lower conversion volume for affiliates that rely on repeat visits. Monitor the impact for at least 30 days and adjust if overall sales drop more than 5 %.
Bot detection tools improve signal quality but are not a silver bullet. Manual review of flagged affiliates remains essential.
Frequently Asked Questions
Which attribution model should I start with?
First‑click is a good default for most merchants because it rewards the partner that introduced the buyer. If you have a robust analytics stack, consider moving to a weighted multi‑touch model after you have baseline data.
How do I set a 48‑hour cookie in ShareASale?
Log in to ShareASale, navigate to Settings → Cookie Settings**, and enter 48 in the “Cookie Duration (hours)” field. Save the changes and test a click to confirm the expiration time.
Can I block all coupon extensions with CSP alone?
No. CSP stops unauthorized scripts, but extensions can still modify form fields. Combine CSP with field ID obfuscation and referral‑timeline checks for reliable protection.
What is the difference between server‑side and client‑side tracking?
Client‑side tracking relies on browser cookies and pixels, which can be overwritten or spoofed. Server‑side tracking records the click on your backend and sends conversion data directly to the affiliate network, eliminating most hijack vectors.
How do I detect bot clicks in my affiliate program?
Look for patterns such as click‑to‑sale lag under 1 second, linear mouse movement, or IPs from known data centers. BotRefund’s detection engine flags these behaviors and reports a 20% bot traffic rate (S2).
What metrics should I include in my monthly audit?
Track click‑to‑sale lag, conversion rate per affiliate, refund rate, and bot‑flag count. Compare each metric to site‑wide averages and investigate outliers.
Can I recover money for bot‑generated clicks?
Yes. BotRefund reports an 83% success rate when submitting evidence to Google and Meta (S2). Prepare logs that show timestamp mismatches, IP anomalies, and CSP violations to strengthen your claim.
By following these six steps and maintaining a disciplined audit cadence, you can build an attribution system that pays only for real, valuable affiliate traffic.
Further reading and comparison sources
These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.
Learn more
Visit the website for more information.