Skip to main content
Affiliate Tabs

How Does Affiliate Link Tracking Work?

What happens between a partner's click and a paid commission: click ids, first-party cookies, attribution windows, and where the chain breaks.

← Back to Blog
8 min read · by Affiliate Tabs

A partner link carries an identifier. When someone clicks, the tracking system records a click and stores that identifier in a first-party cookie. When the visitor later signs up or pays, your system reports the identifier back, and the platform credits the partner if the conversion falls inside the attribution window.

A partner posts a link on a newsletter. Three weeks later a stranger buys your product, and the partner expects a commission. Between those two events sit a redirect, a cookie, a signup form, a payment, and a rule that decides who gets credit. If any one link in that chain is missing, the partner is not paid and nobody knows why.

This is the whole mechanism, in the order it happens, with the places it tends to break.

Inside a tracked link

A partner link is an ordinary URL with an identifier attached. The identifier says which partner, and often which campaign or placement, the click came from. It usually looks like one of two shapes.

  • A redirect link on a tracking domain, such as go.yourcompany.com/acme, which records the click and then forwards the visitor to your site.
  • A direct link to your own page with a parameter, such as yourcompany.com/pricing?ref=acme, where your site or a snippet reads the parameter.

The redirect version is more reliable because the click is recorded on the server before the visitor sees anything. Nothing on the page has to load for the click to count. The direct version is friendlier to read and share, but it depends on your page running the right code. Either way, the first job is the same: write down that this click happened, and give it a unique id.

That id matters more than the partner name. The partner name tells you who gets paid. The click id tells you which specific visit led to which specific signup, which is what you reach for when a partner disputes a number.

Where does the cookie come in?

A click is a moment. A purchase can be days or weeks later. Something has to carry the identifier across that gap, and the standard answer is a cookie set in the visitor's browser when they land on your site.

The cookie holds the click id (and often the partner key). When the visitor comes back and signs up, your site reads the cookie and passes the id along with the signup. Without it, the signup arrives as an anonymous customer and there is nothing to connect it to.

Two properties of that cookie decide how well it works.

First, whose cookie it is. A first-party cookie is set by the site the visitor is actually on. A third-party cookie is set by a different domain embedded in the page, which is how older affiliate networks worked. Browsers have been restricting third-party cookies for years, and many block them outright, so modern tracking sets a first-party cookie from your own domain. If you want the details, tracking when browsers block cookies covers what survives and what does not.

Second, how it was set. A cookie written by JavaScript and a cookie set by the server in an HTTP response header are treated differently by some browsers, and the server-set kind tends to live longer. That is one reason a tracking domain that is a subdomain of your own site (a CNAME pointing at the tracking service) is worth the ten minutes it takes to configure. Affiliate Tabs supports a custom tracking domain on every plan for this reason.

How long does an attribution window last?

The attribution window is the number of days after a click during which a conversion still counts for that partner. Click on day 1, buy on day 25, and a 30-day window pays the partner; a 14-day window does not.

Choosing the length is a business decision, not a technical one. A short window favors partners who catch people at the point of purchase, such as coupon sites. A long window favors partners who introduce a product and wait while the buyer evaluates it, such as reviewers and newsletter authors. If your product has a three-week sales cycle and your window is 7 days, you are underpaying exactly the partners who do the educating.

Most programs also decide whether a second click restarts the clock. If it does, a partner who sends someone back on day 20 earns a fresh window. If it does not, the original click is the only one that counts. In Affiliate Tabs the click window defaults to 90 days, and a repeat click restarts it.

How does the conversion find its way back?

Signup is the first conversion most programs track, and payments come after. There are several ways to report them, and the better setups use more than one.

A JavaScript snippet. A short script on your pages reads the cookie and, when you call its signup function with the customer's email and your own customer id, sends the conversion in. It is the quickest to install and the easiest to lose, because ad blockers and script failures can stop it.

A server-to-server call. Your backend tells the tracking system "this customer signed up" and includes the click id it saved. No browser is involved at that step, so blockers cannot interfere. It takes a developer an afternoon and is the sturdiest option. Link, snippet or server-to-server compares the three methods in more detail.

Payment provider webhooks. Once a customer exists, their payments should not depend on your site code at all. A webhook from Stripe or another billing provider reports each charge, and the platform matches it to the customer already on file. That is how recurring commissions on month 6 still find the right partner.

The pattern that works is to attribute the customer once, at signup, and let every later payment follow the customer. You do not want the system re-deciding the credit on each invoice.

How does the system pick a winner?

If a visitor clicked one partner's link and then, a week later, another partner's, both clicks sit in the window. Someone has to win. The two common rules are last click (the most recent partner is credited) and first click (the original introducer is credited).

Last click is the usual default because it matches how people think about the final nudge, and it is easy to explain. First click rewards discovery. Affiliate Tabs uses last click unless you change the group to first click. Neither is correct in the abstract; the right one depends on whether you want to pay for the introduction or the close. We go through the edge cases in what happens when a customer clicks two partner links.

One visitor, start to finish

Say a partner named Dana shares a link in her newsletter, and your program has a 60-day window.

  1. On March 3 a reader named Sam clicks. The redirect records click c_8841, credited to Dana, and sets a first-party cookie holding that id.
  2. Sam reads, leaves, and comes back directly on March 20. The cookie is still there.
  3. Sam signs up. Your signup handler reads the cookie and sends the click id with the new customer's id.
  4. The platform checks that March 20 is inside the 60-day window from March 3, and attributes Sam to Dana.
  5. Sam pays on March 21. The billing webhook arrives, the platform finds Sam by customer id, and creates a commission against Dana's partnership.
  6. Sam's second payment in April arrives the same way. No click is involved; the customer was attributed once and stays that way.

Notice what Sam never did: click again, enter a code, or tell anyone Dana sent them. That is the best case. Now the ways it fails.

Where do conversions get lost?

Most missing credit is not fraud and not a bug in the platform. It falls into a few families.

A change of device. Sam clicks on a phone in the morning and buys on a laptop at night. The cookie is on the phone; the laptop has no idea Dana exists. This is the single biggest source of untracked conversions in practice, and links alone cannot fix it. Coupon codes can, because the code travels with the person instead of the browser. See when coupon code attribution beats links.

A cookie that never got set or did not last. Privacy settings, content blockers, and in-app browsers (the browser inside a social app, which often discards its storage and sends the user to their main browser to finish) all cut the chain. A server-set cookie on your own subdomain helps with some of these, though no setup removes the problem.

A signup page without the code. Teams add the snippet to the marketing site and forget the app subdomain where signup actually happens, or a redesign drops it. Check by doing a test click yourself and watching for the conversion.

A payment that never matched a customer. Billing events arrive with an email, or a customer id, or nothing useful. If your system never told the platform that customer id 4471 belongs to this email and this click, the payment sits unmatched. A good platform parks those events in a queue instead of dropping them so a person can link them by hand.

A long sales cycle. If a buyer clicks, books a demo, and signs a contract 90 days later, a 30-day window quietly drops the partner. For that kind of sale, attributing at the lead stage (or registering the deal) works better than a cookie. Deal registration, where a partner claims the prospect up front, exists for exactly this.

How do you make the chain harder to break?

You cannot reach perfect capture, and anyone who promises it is selling something. You can get close by giving every conversion more than one way to be credited.

  • Store the click id or partner key on your own customer record at signup, in your database and in your billing metadata. This is the most valuable step. Once it is there, every later payment is matched without any browser involved.
  • Give each partner a coupon code alongside the link, so a purchase on another device still lands.
  • Report signups from your backend, and treat the snippet as a convenience.
  • Run the tracking domain on a subdomain of your own site.
  • Test the whole path yourself every time you change the signup flow: click a partner link, sign up with a throwaway address, pay with a test card, and confirm the commission appears.

In Affiliate Tabs, referral links set a first-party cookie, each click row stores a click id and source, and you can send conversions through the snippet, the API, billing-provider webhooks or a CSV import. Per-partnership coupon codes are matched at checkout through the billing provider or the API, so a customer who never clicked still counts. Every customer record shows which signal was used to attribute it, which is the thing you want in front of you when a partner emails to ask where a sale went. The product page lists the rest.

Which tracking facts should partners hear from you?

Be direct about what is and is not tracked. Tell them the window length, whether a later click restarts it, what happens if two partners are involved, and how to report a sale they think was missed. Partners tolerate a rule they can read far better than a number that moves without explanation.

It also helps to tell them where tracking is weak. A partner who knows that a code is the backup for cross-device buyers will put the code in the video description without being asked. A partner who finds out after three months of silent losses stops promoting you.

Common questions

How long does an affiliate cookie last?
It lasts as long as you set the attribution window, subject to what the browser allows. Many programs use 30 to 90 days. Some browsers cap how long certain cookies survive, so a long window on paper can be shorter in practice for some visitors.
What is a click id?
A click id is a unique string generated for each click on a partner link. It is stored with the click record and passed along when the visitor converts, so the platform can tie one signup or payment back to one click and one partner.
Does affiliate tracking work without cookies?
Partly. Coupon codes, a partner key stored on the customer record, and server-to-server calls all attribute without a browser cookie. A cookie only helps while the visitor stays on the same browser and device between click and purchase.
Why do partners say their conversions are missing?
The usual causes are a click on one device and a purchase on another, a blocked or expired cookie, a snippet missing from the signup page, or a payment that never got matched to a customer. Each leaves a different trail in the click and conversion logs.
Share this article

Start Your First Program

Create an account and set up a program in a single sitting.