# Tracking links, cookies and attribution: how a sale gets credited to you

Affilicourse, module 0: How affiliate marketing works, lesson 3. Source: https://affilicourse.com/lessons/links-cookies-and-attribution (updated 2026-12-03)

> You only get paid for sales the brand can trace back to you. This lesson explains what a tracking link records, how cookies and last-click attribution decide who gets credit, and the everyday reasons a real sale can go unrecorded.

A reader clicks your link, thinks about it for a few days, and then buys. Do you get paid? It depends on things you can't see: a small file in their browser, a time limit, and a rule about who clicked last. This lesson makes those invisible parts visible.

## What a tracking link records

Your affiliate link looks like a normal web address with something extra attached. That extra part is your ID. Sometimes it's a code at the end of the address. Sometimes the link goes through the network's server first and then forwards the visitor to the brand.

When someone clicks, the tracking system records a few things:

- That a click happened, and when.
- Which affiliate the click belongs to: you.
- Often, which link or campaign it came from, if you tagged it.

That last point matters. Many programs let you add your own label to a link, called a [sub-ID](https://affiliwire.com/glossary/sub-id). You might tag one link "youtube-review" and another "newsletter-march." Later, your report shows which one actually produced sales. Module 2 comes back to this in the lesson on trusting the numbers.

## Cookies and cookie duration

The click is only half the story. The visitor may not buy right away. So the brand needs to remember the click until they do.

The usual way is a cookie: a small note stored in the visitor's browser. It says, in effect, "this person arrived from affiliate 12345." If the person comes back and buys, the brand's site reads the cookie and credits you.

Each program sets how long that cookie lasts. This is the [cookie duration](https://affiliwire.com/glossary/cookie-duration). Say a program has a 30-day cookie. If the reader buys on day 12, you get credit. If they buy on day 31, you don't.

Durations vary a lot between programs. Some last a day. Some last months. A longer window helps most when people take time to decide, like with expensive software or travel. For a cheap impulse buy, it matters less.

Not all tracking relies only on browser cookies. Some brands also track on their own servers or link a sale to an account. But the idea is the same: a click is remembered for a limited time, and the program decides what counts.

## Last-click attribution

Now imagine the reader clicked your link, then two days later clicked another affiliate's link, then bought. Who gets paid?

Most programs use [last-click attribution](https://affiliwire.com/glossary/last-click-attribution). The most recent affiliate click before the sale wins the whole commission. The earlier click, yours, gets nothing.

This feels unfair, and sometimes it is. You may have done the real work of explaining the product. A coupon site may have caught the reader at checkout with a code. Under last-click, the coupon site gets paid.

Some programs use other rules. A few split credit, or give it to the first click. Always check the terms. But assume last-click unless the program says otherwise. The broader topic is called [attribution](https://affiliwire.com/glossary/attribution), and it's worth knowing the word.

*Diagram: a 30-day cookie.* Day 0, a reader clicks your link and a cookie is set. If they buy on day 12, the sale is yours. If another affiliate's link is clicked after yours, the last click usually wins. After day 30 the cookie expires and a purchase earns you nothing.

## Four ways a sale slips away

Here are the common leaks. Each one means a real buyer you sent, and no commission.

### The cookie expires

The reader takes longer to decide than the cookie lasts. On a 7-day cookie, a purchase on day 8 is lost. This hits hardest on products with long buying cycles.

### Another affiliate clicks later

The reader clicks your review, then searches for a discount and clicks a coupon site's link. Under last-click, the later affiliate takes the credit.

### Blocked or cleared cookies

Some browsers limit tracking cookies by default. Some people use ad blockers or privacy tools that strip tracking. Some clear their cookies often. In each case, the note that says "this came from you" may be gone.

### A different device

The reader watches your video on their phone at lunch. That evening they buy on their laptop. The cookie lives on the phone. The laptop knows nothing about you, so the sale looks like it came from nowhere.

## What you can do about it

You can't fix every leak. Tracking is never perfect, and every affiliate loses some sales they earned. But you can reduce the damage.

- **Prefer longer cookies for slow decisions.** If people take weeks to buy, a one-day cookie is a poor fit.
- **Make the click close to the purchase.** Content that helps someone decide now, like a comparison or a how-to-buy guide, tends to get the last click.
- **Ask about tracking.** Some programs track sales to a logged-in account or a coupon code tied to you. That survives device switches.
- **Test your links.** Click them yourself before you send traffic. A broken link earns nothing.
- **Watch your numbers.** If clicks rise and sales don't, something may be leaking.

### A quick example

Say you send 1,000 clicks to a product in a month, and your dashboard shows 10 sales. You might assume that's the whole story. It often isn't.

Some readers bought on another device. Some came back after the cookie expired. Some clicked a coupon site at checkout. Those sales happened because of you, but they were never recorded as yours.

You will never see those missing sales in any report. That's why two programs with similar products can show very different results for the same content. Tracking quality and attribution rules are part of what makes an offer good or bad, and Module 2 scores them.

The key lesson is simple. Your commission depends on the brand recording the sale, not just on the sale happening. Choose programs and content with that in mind.

## Key points

- A tracking link carries your affiliate ID, so the brand knows the visitor came from you.
- A cookie remembers that click for a set time, called the cookie duration.
- Under last-click attribution, the most recent affiliate click before the sale usually gets all the credit.
- Sales slip away when the cookie expires, another affiliate gets a later click, cookies are blocked, or the buyer switches device.
- You can't fix every leak, but you can choose programs and content that reduce them.

## Try this

Click one of your own affiliate links in a private browser window. Look at the address you land on and find the part that identifies you. Then read that program's terms for its cookie duration and attribution rule.
