Clear Commerce

Affiliate Tracking Basics: How Your Links Get Credit

By the Clear Commerce Editorial Team · Updated November 16, 2026

Woman testing a link on her phone among houseplants

Affiliate tracking is how a program knows a sale came from you. Your link carries a unique ID. When someone clicks it, the program records the visit, often with a cookie or a similar method, and if that person buys within the program's rules, the sale is credited to your account. Knowing how this works in general terms helps you set up links correctly and spot problems early.

Tracking sits underneath everything else in our Affiliate Marketing section, so it's worth an hour of your time even if the technical side isn't your favorite.

Most affiliate links have a few pieces. The exact format differs by program and network, so treat this as a general picture:

PartWhat it doesWhat can go wrong
DestinationThe page the visitor lands onVendor moves or deletes the page
Affiliate IDIdentifies you to the programGets cut off when you edit or shorten the link
Sub-ID or tag (optional)Labels where the click came fromTypos make reports confusing
RedirectPasses the visitor through the tracking systemSome apps or browsers interfere with it

Always copy links from the program's own dashboard or link tool. Typing them by hand, or trimming the end of a long link to make it look neater, is a common way to lose credit.

Cookies and tracking windows, in plain terms

After a click, many programs store a small record in the visitor's browser, called a cookie, that says "this visitor came from affiliate X." If the visitor returns and buys before that record expires, the program can still credit you. The length of time it lasts is often called the cookie duration or attribution window, and it varies by program.

A few general points to know:

  • Programs decide the rules. How long tracking lasts, which purchases count, and who gets credit when several affiliates are involved are all set by each program. Read the terms.
  • It isn't perfect. Visitors clear cookies, switch devices, use private browsing or block trackers. Some sales you helped with will never show up in your reports.
  • Refunds and cancellations matter. Many programs reverse a commission if the order is refunded or returned.
  • Some programs use other methods. Not all tracking relies on browser cookies. Some programs use server-side tracking or coupon codes. Your program's help pages will explain what it uses.

On ClickBank, for example, tracked affiliate links are called hoplinks. Our guide to how to start affiliate marketing covers joining your first programs and getting your first links set up.

Sub-IDs: learning what helps

Where a program supports them, sub-IDs let you add a short label to each link, such as "email-march" or "review-grinder." Your reports then show which links people actually used.

That information isn't just about commissions. It tells you which content readers find useful enough to act on. If one comparison page gets clicks and another gets none, the second may be confusing, off-topic or missing what people need. Our guide to conversion rate basics explains how clarity, trust and speed affect whether visitors take the next step, and how to test changes carefully.

A simple sub-ID naming system

Keep labels short, lowercase and consistent:

  • Channel first: "blog", "email", "video" or "social".
  • Then the piece: a short page name or the send date.
  • Then position if it matters: "top" or "bottom".

Example: "blog-coffee-grinders-top." Write your system down so you use it the same way every time.

Broken links are one of the easiest problems to miss and to fix. Use this routine monthly and after any change to your site or a vendor's site.

  1. Click it as a visitor would. Use a private or incognito window so you see what a new visitor sees.
  2. Check the landing page. Does it go to the right product and the right page, not an error or a home page?
  3. Check the ID is intact. Look at the final address in your browser, or use the program's link checker if it has one.
  4. Test on a phone. Some links behave differently in mobile apps.
  5. Check your reports. A day later, see whether your test click appears in the program dashboard. Some programs don't show clicks right away.
  6. Log what you found. Note the date and any fixes.

Never make test purchases to inflate your numbers, and read your program's rules before buying through your own link. Many programs forbid it.

Some affiliates use redirect tools to make long links tidier. That can be fine, but be careful:

  • Some programs and platforms restrict shortened or redirected affiliate links. Check their terms.
  • A tidy link doesn't remove the need for disclosure. Readers should still know it's an affiliate link before they click.
  • Every extra redirect is another place a link can break, so test redirected links as carefully as direct ones.

When numbers don't add up

If your reports seem off, work through it calmly. Re-test the link. Check whether the product page changed. Review the program's tracking rules. Look for refunds. If something still seems wrong, contact affiliate support with specific dates and links. Many tracking puzzles turn out to be a broken link or a rule you didn't know about. Our guide to affiliate marketing mistakes covers other quiet problems like this.

A worked example

Fictional, for illustration only. Morgan runs a small site about indoor plants and a monthly email. They notice their reports show clicks from the site but none from email. Testing the email link in a private window, Morgan finds the email tool shortened it and dropped the affiliate ID. They switch off that setting, copy a fresh link from the program dashboard, add the sub-ID "email-april" and test again. The next day, the test click shows up. Morgan adds "check email links" to their monthly routine.

If tracking still feels abstract, our explainer on what affiliate marketing is covers how the vendor, network, affiliate and buyer fit together.

Do this today

Take 30 minutes and:

  1. Pick five of your most important affiliate links.
  2. Test each one in a private window and on your phone.
  3. Confirm each lands on the right page with your ID intact.
  4. Write down a sub-ID naming system and add labels to one page's links.
  5. Read the tracking section of one program's terms.

Good tracking won't create sales, and results vary widely. It does make sure that when your help leads someone to buy, the credit isn't lost along the way.

Partner offer · paid placement

Want a step-by-step business course?

Some people like the structure of a paid guide. This button opens a third-party online business program from one of our advertising partners. Results vary and most people earn little or nothing at first. Its claims are its own, not ours, so weigh them against our red flags checklist.

See the partner program →

We may be paid when you click. The program shown can change. Read its terms before you buy anything. How this works

Frequently asked questions

How does affiliate link tracking work?

Your affiliate link contains an ID that tells the program the visitor came from you. When someone clicks, the program usually records that visit, often with a cookie or similar method, so a later purchase can be credited to you under the program's rules.

What is a sub-ID in affiliate marketing?

A sub-ID is an extra label you add to a link, where a program supports it, to see which page, email or video a click came from. It helps you learn what content is actually useful to readers.

Why didn't I get credit for a sale?

Common reasons include a broken or edited link, the buyer clearing cookies or using another device, a purchase outside the program's tracking window, a refund, or a sale type the program doesn't pay on. Check the program's terms and reports, and contact affiliate support if something looks wrong.

See a partner coursePartner offer
Partner offer · paid placement

Want to see a business course?

If you'd like more structure than articles can give, you can look at a third-party business course from one of our partners. Its claims are its own. No pressure: our free guides aren't going anywhere.

See the partner program →

We may be paid when you click. How this works