What is an affiliate link, and how does it work?
An affiliate link is a tracked URL that credits you when someone buys. Here's how the tracking works, what the codes in the URL mean, how cookies and attribution decide who gets paid, and how to share links properly.
An affiliate link is a link to a product that carries a code identifying you. When someone clicks it and buys, the company knows the sale came from you and pays you a commission.
What an affiliate link looks like
Most affiliate links are the company's normal URL with something added. A few common patterns:
- A query parameter: example.com/?via=yourname, example.com/?fpr=yourname, example.com/?ref=yourname
- A network tracking link: a URL on the network's domain that redirects to the company, used by networks like Impact and PartnerStack
- A short link: a branded short URL from the company or a tool like Dub
The code (yourname, or a long ID) is what matters. Everything else is just the destination.
How the tracking works
- The click. A reader clicks your link. The company's site, or the network, records the click and your ID.
- The cookie. A small file is saved in the reader's browser saying "referred by this affiliate". Many programs also store the ID server-side when the reader signs up.
- The window. The cookie lasts a set time: the cookie duration. 30 days is common; some software programs give 60, 90 or even 180 days.
- The purchase. If the reader signs up or buys within that window, the sale is credited to you.
- The payout. After a holding period (to allow for refunds), the commission is paid to you on the program's schedule.
Who gets credit when there are several links?
This is called attribution. Most programs use last click: if a reader clicks your link, then a week later clicks another affiliate's link and buys, the other affiliate gets the sale. Some use first click, crediting whoever sent the reader first. A program's terms say which it uses, and it's worth knowing before you build content around it.
Why cookie length matters
People rarely buy software on the first visit. They read a review, try the free plan, and come back. With a 30-day cookie, a reader who returns on day 40 earns you nothing. With 90 days, you're still credited. Our guide to commissions and cookies explains this with examples, and our long-cookie list shows programs with 90 days or more.
How to get an affiliate link
- Find the company's affiliate program (each program page here links to it).
- Apply: on the company's own site, or through its network.
- Once approved, copy your link from the dashboard. Many dashboards also let you link to any page on the company's site, not just the homepage.
How to share affiliate links properly
- Disclose it. Tell readers you earn a commission, clearly and before they click. See our disclosure guide.
- Mark it in your HTML. Add rel="sponsored" to affiliate links. This is how Google asks sites to label paid links.
- Link to the right page. If you're writing about a feature, deep-link to that feature's page.
- Keep them working. Programs change networks and links break. A redirect on your own domain (yoursite.com/go/tool) lets you update every link in one place.
Common questions
Does using an affiliate link cost the buyer more? No. The price is the same. Some programs even give your audience a discount.
Can I click my own affiliate link to buy? Most programs forbid self-referrals, and they're usually detected. Check the terms.
Can I use affiliate links in emails? Usually yes, but some programs restrict email promotion, and most ban sending to lists you didn't build. Check the terms first.
Frequently asked questions
What is an affiliate link?
A normal link to a product with a tracking code that identifies you. When someone clicks it and buys within the cookie window, the company credits the sale to you and pays a commission.
How do I get an affiliate link?
Join the company's affiliate program, either on its own site or through a network like PartnerStack or Impact. Once approved, your dashboard gives you a personal link.
Do affiliate links cost the buyer more?
No. The price is the same; the commission comes out of the company's marketing budget. Some programs even give your audience a discount.
Are affiliate links safe to click?
Links from legitimate programs simply redirect to the company's site with a tracking code. They don't install anything.