How Affiliate Link Tracking Works: A Technical Guide
Every time someone clicks an affiliate link and makes a purchase, a chain of technical events connects that click to the eventual sale. Understanding this chain is essential whether you are a merchant setting up an affiliate program or an affiliate trying to understand why some conversions are not being tracked.
This guide explains the full technical flow of affiliate link tracking, from the initial click to the final commission payment.
The Affiliate Link
An affiliate link is a standard URL with one or more tracking parameters appended. These parameters identify the affiliate and, optionally, the specific campaign, creative, or sub-affiliate.
A typical affiliate link looks like:
https://merchant.com/product?ref=affiliate123&sub_id=campaign_xyz&utm_source=affiliate&utm_medium=content&utm_campaign=review
The key components:
- ref=affiliate123: The affiliate's unique identifier
- sub_id=campaign_xyz: A sub-ID the affiliate uses to track which of their own campaigns sent the traffic
- UTM parameters: Standard marketing attribution parameters
The Click Flow
Step 1: The Click
A visitor clicks the affiliate link on a blog, review site, social media post, or email.
Step 2: The Redirect (Optional)
Many affiliate links route through a tracking domain first. For example:
https://track.affiliatenetwork.com/click?aid=123&cid=456 → https://merchant.com/product
This intermediate step allows the network to log the click and set tracking cookies before the visitor reaches the merchant's site.
Step 3: Cookie Placement
When the visitor arrives at the merchant's site (either directly or via redirect), the tracking system places a cookie in the visitor's browser. This cookie contains the affiliate's identifier and an expiration timestamp.
Step 4: The Browsing Session
The visitor browses the merchant's site. They may visit multiple pages, add items to cart, leave, and return later.
Step 5: The Conversion
When the visitor completes a purchase, the merchant's checkout system reads the tracking cookie and associates the sale with the affiliate identifier stored in it.
Step 6: Attribution
The sale is credited to the affiliate in the tracking system. The affiliate sees the conversion in their dashboard, and the commission accrues to their account.
Tracking Parameter Types
Affiliate ID Parameters
?ref=,?aff_id=,?affiliate_id=— identify the affiliate- Network-specific:
?a_aid=(Awin),?afftrack=(CJ),?sid=(ShareASale)
Sub-ID Parameters
?sub_id=,?subid=,?click_id=— let affiliates track their own campaigns- These are passed through to the conversion report so affiliates can see which specific links, pages, or campaigns drove each sale
Click IDs
?click_id=,?clickid=— unique identifiers for each individual click- Used for server-side postback tracking and deduplication
Common Affiliate Link Structures by Network
| Network | Link Structure |
|---|---|
| ShareASale | https://www.shareasale.com/r.cfm?b=xxx&m=xxx&u=xxx |
| CJ Affiliate | https://www.anrdoezrs.net/click-xxxxxxx-xxxxxxx |
| Impact | https://merchant.sjv.io/c/xxx/xxx/xxx |
| Awin | https://www.awin1.com/awclick.php?gid=xxx&mid=xxx&awinaffid=xxx |
| PartnerStack | https://merchant.grsm.io/affiliate_id |
| FirstPromoter | https://merchant.firstpromoter.com/affiliate_id |
Why Tracking Breaks
Cookie Blocking
Browsers increasingly block third-party cookies. Safari blocks them by default. Firefox blocks known tracking cookies. Chrome is phasing them out. When cookies are blocked, the standard tracking flow fails.
Cookie Expiration
If a visitor clicks an affiliate link but does not purchase within the cookie window (typically 30 days), the cookie expires and the conversion is not attributed.
Cross-Device Journeys
Cookies are device-specific. A visitor who clicks an affiliate link on mobile but purchases on desktop is not tracked unless the merchant uses additional matching methods.
Ad Blockers
Ad blockers prevent tracking scripts from loading. If the merchant's site relies on a JavaScript-based tracking pixel, ad-blocked visitors will not be tracked.
Redirect Chains
Long redirect chains can lose tracking parameters. If a link passes through multiple redirects, URL parameters may be stripped by intermediate servers.
Frequently Asked Questions
What is the standard affiliate cookie duration?
30 days is the most common cookie duration. Some programs offer 60, 90, or even lifetime cookies. Longer durations benefit affiliates by giving them credit for delayed purchases.
Can affiliate links work without cookies?
Yes. Server-side tracking using click IDs and postback URLs does not rely on browser cookies. This approach is becoming more common as browser cookie restrictions increase.
Why do some of my affiliate conversions not track?
The most common causes are cookie deletion (visitors clearing cookies), ad blockers preventing tracking pixels, cross-device journeys (clicking on mobile, buying on desktop), and cookie expiration (purchasing after the cookie window closes).
What is a postback URL?
A postback URL (also called a server-to-server callback) is a URL that your tracking system calls when a conversion occurs. It sends the conversion data directly between servers, bypassing browser-based tracking entirely.
Further Reading
Explore the full Affiliate Marketing Tools & Software guide for more articles on this topic.
Try it yourself: Use our Free Affiliate Checker to put these strategies into practice.
Ready to grow your affiliate program? Try AffiliateSpy free — scan any competitor and see their verified affiliates in minutes.