Partnerships
All articles Guides

How to Track Affiliate Sales (2026 Guide)

How to track affiliate sales accurately: tracking links, server-side postbacks, coupon codes, attribution windows, and the reconciliation step before you pay a commission.

By the Partnerships team · July 2026 · 10 min read

Partner Desk
You approve before anything sends
Try

Describe your product, find your partners

Partnerships surfaces the companies who should resell, refer, and integrate with you, ranked by a transparent fit score, then drafts the outreach for you to approve.

You fit Partner
↑ pick a product and hit Find partners

Ideal partners for

ranked by fit

Drafted outreach · Drafted outreach

Writing

Click a match to draft a first-touch message in your voice.

Sent

A human approves every outreach before it sends. Nothing goes out automatically.

Partner pipeline

Co-sell revenue

One co-sell overlap surfaced from account mapping. Referral and co-sell revenue tracked per partner.

Live, interactive · ranked by transparent fit

Ranked by transparent fit · you approve every outreach · no marketplace tax · you own your partner list

To track affiliate sales, give every affiliate a unique tracking link, record the click with a first-party cookie and a server-side click ID, then fire a postback when the order confirms so the sale maps back to that affiliate. Set an attribution window (30 days is the common default, 60 to 90 for SaaS), deduplicate against your paid and email channels, and reconcile tracked conversions against your billing system before you approve any commission. Coupon codes cover the creators whose audience never clicks a link.

What is affiliate tracking?

Affiliate tracking is the system that connects a click on an affiliate's link to a sale on your site, so you know which partner earned which commission. It has three parts: a unique identifier per affiliate, a way to hold that identifier while the buyer shops, and a conversion event that reports the completed order back with the identifier attached.

Everything else sits on top of those three pieces. When tracking breaks, affiliates notice before you do, and the good ones quietly stop promoting you rather than open a ticket. Owning that chain end to end is why teams buy affiliate tracking software instead of stitching UTM parameters to a spreadsheet: one system holds the identifier, the storage, and the conversion event, and it can tell you which link in the chain snapped.

How does affiliate tracking work?

Affiliate tracking works in four steps. A visitor clicks a link carrying the affiliate's ID. Your tracker records the click and issues a click ID. The identifier gets stored in a first-party cookie and, ideally, in your own session or account record. When the order confirms, a postback or pixel reports the order ID and value with that click ID attached.

Tracking links, UTMs, and sub-IDs

An affiliate link is your URL plus an identifier: yoursite.com/pricing?ref=janedoe or a redirect like yoursite.com/r/janedoe. The redirect form is better, because it lets your server set a first-party cookie and log the click before the visitor lands on a page. Sub-IDs (usually subid or sub1) are how affiliates tag their own placements. Pass them through untouched and report on them: a publisher who can see which placement converts will promote harder, because they can optimize.

UTMs are a separate concern, and this is where programs get into trouble. Tag links with utm_medium=affiliate so your analytics can group the traffic, but never calculate commission from UTMs. They get stripped by redirects, rewritten by apps, dropped on cross-domain checkout hops, and edited by anyone with a keyboard. The affiliate ID and click ID are your source of truth. UTMs are for reporting.

How do you track affiliate sales?

Five methods are in real use: cookie-based click tracking, server-to-server postbacks, coupon codes, unique landing URLs, and direct API calls from your billing system. Most working programs run two at once, a link-based method for the bulk of partners and coupon codes for creators. Each has a specific failure mode, so pick deliberately rather than by default.

Method How it works Best for Weakness
Cookie-based (client side) Click sets a cookie with the affiliate ID. A pixel on the confirmation page reads it and reports the sale. Fast setup, e-commerce with a short path to purchase. Ad blockers, ITP cookie caps, and cross-domain checkouts silently drop conversions.
Server-to-server postback Click issues a click ID. Your server stores it with the order and posts it to the tracker on confirmation. SaaS, subscriptions, anything with a backend or a long cycle. Needs engineering work, and you must persist the click ID through checkout.
Coupon code Each partner gets a unique discount code. Orders using it are credited to that partner. Podcasts, video, print, events, any audience that will not click. Codes leak to deal sites, so you credit sales you already had.
Unique landing URL Partner sends traffic to a dedicated page, and conversions on it are theirs. A few high-volume partners, co-marketing pages, embedded offers. Does not scale past a handful, and misses buyers who navigate away first.
Billing system API Your app records the referrer on the account and pushes conversions, renewals, and refunds by API. Recurring revenue where commission depends on retention. Most build effort, and you own reconciliation logic a platform would give you.

If your program is customers referring customers rather than media partners promoting you, the mechanics are identical but the identifier is a customer account, which is what referral tracking is built around. The tracking layer barely changes. The fraud profile and the payout rules do.

Can you track affiliate sales without cookies?

Yes, and increasingly you have to. Third-party cookies are blocked by default in Safari and Firefox and stripped by ad blockers elsewhere, so the old model of a network setting a cookie on its own domain is finished. What still works: first-party cookies set by your own server, server-side click IDs, coupon codes, and binding the referrer to the user account at signup.

The distinction that matters is who sets the cookie. A third-party cookie belongs to the network's domain and is dropped before it does anything. A first-party cookie set by your server, on your domain, through a redirect you control, survives. Even then there are limits: Safari's Intelligent Tracking Prevention caps cookies written by JavaScript at seven days, and as little as one day when the visitor arrived from a cross-site link carrying query parameters. Cookies your server sets with an HTTP header are not capped the same way, which is the concrete argument for the redirect-and-set pattern over a JavaScript snippet.

The durable answer is to stop depending on the browser. On click, write a row: click ID, affiliate ID, sub-ID, timestamp, landing page. Put the click ID in a first-party cookie and also carry it as a hidden field through signup or checkout. The moment the visitor creates an account or completes an order, write the click ID onto that record server side. From then on the attribution lives in your database, where no browser setting or cleared cache can touch it. That is why postback tracking ages well.

How do you track affiliate sales in Google Analytics?

Tag affiliate links with utm_medium=affiliate and utm_source set to the partner name, send a purchase event with a unique transaction_id, then report revenue by source and medium. GA4 groups traffic where utm_medium is exactly "affiliate" into its Affiliates channel. It is a useful cross-check on your tracker. It cannot pay anyone.

  • Get the medium exactly right. GA4's Affiliates channel matches utm_medium equal to "affiliate" and nothing else. Use "affiliates" or "partner" and your traffic lands in Referral, mixed in with everything else.
  • Always send transaction_id. Without it GA4 double-counts orders on refreshes and back-button hits, and you lose the join key you need to reconcile against your tracker.
  • Expect a gap, and size it. GA4 undercounts because of consent banners and blockers, and it uses its own last non-direct click model with its own lookback, which will not match your window. A stable gap is normal. A gap that moves suddenly means something broke.

Use GA4 for questions your tracker cannot answer: which landing pages affiliate traffic converts on, how affiliate buyers compare on order value, whether a partner's traffic bounces. Do not use it to calculate a payout.

What is the best way to track affiliate commissions?

Server-to-server postback tracking with a first-party click ID, backed by coupon codes for partners whose audience will not click, and reconciled monthly against your billing system. Client-side pixels alone under-report. Coupon codes alone over-credit. Running both and reconciling against the system that actually charges the card is the setup that survives an argument with a partner.

Then write the commission rules down before you launch, because each one becomes a dispute eventually:

  • Pay on net revenue, the amount collected after discounts, refunds, and chargebacks, not gross cart value.
  • Hold before you pay. A 30 to 60 day hold covers your refund window. Show the commission as pending, not approved, and say so in the terms.
  • Lock the rate at the time of sale. If you change rates in March, February's sales pay February's rate. One line that prevents a very bad conversation.
  • Decide recurring versus first-order up front. For subscriptions, state whether commission is first payment only, a fixed number of months, or lifetime, and what happens on upgrade and cancellation.

How long should an affiliate attribution window be?

Thirty days is the common default for e-commerce, and 60 to 90 days fits SaaS where buyers evaluate for weeks. Set it from your own data: pull your time from first touch to purchase, find where the curve flattens, and set the window there. Copying a competitor's number tells you nothing about your buyers.

Then decide what happens when two affiliates touch the same buyer. Last click wins is the default almost everywhere: the most recent affiliate click inside the window takes the sale, overwriting the earlier one. It is simple and it is what affiliates expect, but it underpays the content partner who introduced you and overpays whoever sat closest to checkout. First-click-wins within a shorter window protects review sites and newsletters. Splitting credit across touches is fairer and much harder to explain, and a commission a partner cannot predict is one they will not invest in. Most programs should stay on last click and fix coupon-site leakage instead, which is where the money is actually going.

How do you stop paying for affiliate sales you already had?

Deduplication decides which channel gets credit when several touched the same order. Set a written precedence rule, apply it before commissions are approved, and publish it in your program terms. The common rule: if the buyer arrived from your own paid ad or your own marketing email in the same session as the affiliate click, the affiliate does not get paid.

  • Coupon code leakage. A creator's code lands on a deal site. A buyer already in your cart opens a tab, searches your brand plus "coupon", clicks, and returns. That last click credits a partner who added nothing. Flag orders where click-to-conversion time is under a minute and the referrer is a coupon domain.
  • Brand bidding. An affiliate buys ads on your own trademark, intercepts buyers who were already coming, and bills you for them. Ban it in the terms, then check monthly, because it will not stop on its own.
  • Self-referrals. Affiliates ordering through their own link, or signing up staff. Match order emails, payment fingerprints, and IPs against affiliate accounts, and state the rule plainly.
  • Cookie stuffing. Invisible iframes or forced redirects setting your cookie on visitors who never saw a link. The signature is a high click count with an implausibly low conversion rate.

How do you reconcile tracked sales to what you actually pay?

Reconciliation matches every tracked conversion to a real, paid, unrefunded order in your billing system before a commission is approved. Pull both lists monthly, join them on order ID, and work three buckets: tracked but not billed, billed but not tracked, and billed at a different amount. Each has its own cause and its own fix.

Tracked but not billed usually means failed payments, cancelled orders, or a test order that leaked into production. Billed but not tracked is the one that costs you partners: the click ID did not survive the path to purchase, usually a cross-domain checkout, an app-to-web handoff, or a signup flow that drops the parameter. Amount mismatches are almost always discounts, tax, or currency applied in a different order than your commission rule assumes.

Assume your affiliates are checking your math. The serious ones run several programs at once and keep their own record of what each program pays them, so a statement that quietly drops a few orders gets noticed, and it costs you the partner rather than the argument. Send a statement they can audit: order date, order ID, order value, rate, commission, and status.

Where to start if you are setting this up now

In order, because each step depends on the one before it:

  1. Pick the link format and ship the redirect. Your domain, your server, your first-party cookie, set with an HTTP header. Log click ID, affiliate ID, sub-ID, and landing page.
  2. Persist the click ID server side. Carry it through signup or checkout and write it onto the order record. Everything downstream depends on this step.
  3. Fire the postback on order confirmation with order ID and net value, and a second event on refund so pending commissions reverse themselves.
  4. Write down the window, the dedup precedence, and the hold period, and publish them in your terms before you recruit anyone.
  5. Issue one coupon code per partner, block stacking, and monitor the deal sites monthly.
  6. Reconcile month one by hand before you pay a single commission. You will find at least one broken path, and you would rather find it than have a partner find it.

A program that pays accurately can be scaled, and one that does not loses its best partners quietly. If you are still at the design stage, the questions around rates, terms, and first partners are covered in starting an affiliate program. Once the plumbing holds, the constraint moves to finding partners worth tracking, which is where Partnerships fits: the BD agent surfaces affiliates ranked by fit with the reasons shown, drafts outreach a human approves before anything sends, and tracks referral and co-sell revenue on flat monthly pricing with no cut of what your affiliates earn. The ongoing work of managing affiliates gets much easier when the numbers underneath it are trustworthy.

Last updated July 2026.

Run this on your product

Partnerships finds your ideal partner companies ranked by fit, drafts the outreach you approve, and tracks the referral and co-sell revenue they drive.

Explore features

Find your ideal partners and draft the outreach.

Describe your product, get partners ranked by fit, approve the outreach, and track the revenue they drive. Flat pricing, no marketplace tax.

See pricing

Ranked by transparent fit · you approve every outreach · no marketplace tax