BixGrow
GuidesLast updated

Affiliate Links or Coupon Codes? How to Track Affiliate Sales on Shopify

Affiliate links or coupon codes? See where each one breaks, which works best for every channel, and who earns the commission when both land on the same Shopify order.

Finn Vu
A blog post link revealing an affiliate URL with a random ID, yourstore.com/?bg_ref=aZ4kT9qLm2, next to an Instagram-style post with the caption 'Use code QUINN15 for 15% off'.
On this page

Do you know exactly which affiliate should get credit for each sale? Tracking decides who gets paid and which partners you invest in, and small gaps add up to overpaid commissions and frustrated affiliates.

Shopify merchants usually track affiliates in two ways:

  • Affiliate links credit the sale when a shopper clicks the affiliate's link and then buys.
  • Coupon codes credit the sale when a shopper types the affiliate's code at checkout.

This guide shows where each one breaks, how to use them together, and who gets paid when both land on the same order.

TL;DR
• Use both. Links work where people can click. Codes work where they can't, like videos, podcasts and offline, and across devices.
• Each has a weak spot. Links lose credit when the cookie is lost: Safari's 7-day limit, device switches, in-app browsers. Codes leak to coupon sites, so you pay commission on sales you'd have made anyway.
• One order pays one affiliate. When a link and a code meet, BixGrow checks the lifetime link first, then the code, then the last link clicked.

What credited 10,000 affiliate orders

In the latest 10,000 affiliate orders across BixGrow stores, coupon codes credited 61% and affiliate links 26%. Lifetime customer links, which keep crediting repeat buyers to the affiliate who first referred them, credited another 11%, and the last 2% came from royalty and recurring orders.

Donut chart of 10,000 affiliate orders by what credited them: coupon codes 61%, affiliate links 26%, lifetime customer links 11%, and other 2%.
Source: BixGrow order data, the latest 10,000 affiliate orders up to October 2026.

Why codes credit most orders

Two things push codes ahead:

  • A code comes with a discount. Shoppers have a reason to find it and type it, so it rarely gets skipped.
  • A code wins ties. When an order has both a link click and a code, most apps, BixGrow included, credit the code. Some of the 61% started with a link click.

So the split doesn't mean links don't work. It shows which rule had the final say on each order. A very high code share can also be an early sign that codes are leaking, which we cover below.

Each affiliate gets a unique link with a random ID code, for example yourstore.com/?bg_ref=aZ4kT9qLm2. When a shopper clicks it, a small file called a cookie is saved in their browser. The cookie records which affiliate sent them.

Most shoppers don't buy on their first visit, so the cookie stays in place for a set period. If the shopper comes back and places an order before it expires, the sale is credited to that affiliate and they earn a commission.

With BixGrow, you choose how long the cookie lasts. It can be anything from 24 hours to 90 days or more, and 30 days is common. A longer window gives affiliates more time to earn from the traffic they send.

If the cookie expires, or the shopper clears their browser data, the sale can't be linked back to the affiliate.

Note: Safari on iPhones and Macs can delete this cookie after 7 days if the shopper doesn't return to your store. Giving affiliates a coupon code is a good backup.

How affiliate link tracking works: the affiliate shares a link with their ID, the shopper clicks and the browser saves a cookie, then either buys right away or leaves and comes back 12 days later without the link. Either way the cookie credits Quinn with the commission. A side box lists when the cookie can be lost: switching device or browser, private browsing or cleared cookies, Safari's 7-day limit, and clicking in an app but buying in a browser.
  • They switch devices. They tap the link on their phone, then buy later on their laptop. The cookie only exists on the phone.
  • They leave the app's browser. Links opened in Instagram or TikTok load inside the app. If the shopper later opens your store in Safari or Chrome to buy, the cookie isn't there.
  • The cookie is gone. It expired, or the shopper cleared cookies or browsed in private mode. Safari also deletes cookies like these after 7 days.
  • They blocked tracking. In places with cookie banners, like the EU and UK, tracking waits until the shopper clicks Accept. Some ad blockers also stop tracking scripts.

Adding UTM parameters to affiliate links is worth it if you use Google Analytics. UTMs are tags at the end of a link that tell GA4 who sent each visitor, so you can see affiliate traffic and sales next to your ads and emails. They don't decide who earns the commission. The affiliate link or coupon code still does that.

Without UTMs, GA4 usually files an affiliate's visitors under the site they clicked from, like Instagram, or as direct traffic. You can't tell which affiliate sent them.

Example: Quinn is a skincare blogger in your affiliate program. You add three tags to Quinn's link:

TagWhat it tells GA4Quinn's value
utm_sourceWho sent the visitorquinn
utm_mediumWhat kind of traffic it isaffiliate
utm_campaignWhich program or promotionsummer-ambassadors

Before: yourstore.com/?bg_ref=aZ4kT9qLm2

After: yourstore.com/?bg_ref=aZ4kT9qLm2&utm_source=quinn&utm_medium=affiliate&utm_campaign=summer-ambassadors

In GA4, go to Reports > Acquisition > Traffic acquisition and switch the table to Session source / medium. Quinn's visits show up as "quinn / affiliate". If your store sends orders to GA4, Quinn's purchases and revenue appear on the same row.

GA4 Traffic acquisition report set to Session source / medium and filtered by "affiliate", listing each affiliate's visits, with the "quinn / affiliate" row highlighted.
Illustrative example with sample affiliates and figures.

Two tips from Google's UTM guide:

  • Use all three tags. A missing one shows up as "(not set)" in your reports.
  • Keep values lowercase and spelled the same way. GA4 treats "Quinn" and "quinn" as two different sources.

You don't have to tag each link by hand. In BixGrow, go to Settings > Affiliate link > Add UTM to affiliate links and set the source to {affiliate_name}. BixGrow then adds the tags to every affiliate link for you. See how.

How discount code tracking works on Shopify

Discount code tracking credits a sale to the affiliate whose code the shopper types at checkout. In BixGrow, you assign each affiliate their own discount code, and every order that uses it is credited to them. No click or cookie is needed.

For example:

  1. You give Quinn the code QUINN15 for 15% off.
  2. Quinn mentions it in a video. A week later, a viewer types QUINN15 at checkout on a different device.
  3. The order is credited to Quinn, because the code is Quinn's.

Because there's no cookie, codes work where links fail: across devices, in podcasts and videos, on printed flyers, and when a shopper declines cookies. The catch is that codes travel. Once QUINN15 lands on a coupon site or browser extension, Quinn gets credit for shoppers Quinn never reached. A shopper who forgets to type the code isn't credited to anyone. And every tracked sale comes with a discount, which cuts into your margin.

BixGrow Conversions page with order #1120 credited to affiliate Quinn Ivy, tracked by link and coupon with the code QUINN15.

How do you stop affiliate codes from leaking to coupon sites?

Why codes leak

  • Shoppers post codes they've used on coupon sites and deal forums.
  • Coupon extensions like Honey pick up codes typed at checkout and offer them to other shoppers.
  • Some affiliates post their own codes on coupon sites to earn more commission.

Why it's a problem

Say QUINN15 lands on a coupon site. A shopper who was already about to buy sees it pop up at checkout, takes 15% off, and Quinn earns commission. You've paid a discount and a commission on a sale you would have made anyway.

Your reports suffer too. Quinn looks like a top performer, even though many of those orders came from strangers. And if the shopper first clicked another affiliate's link, many affiliate apps give the sale to the code, so the affiliate who actually sent them loses out.

The fix: anti-leak coupons

BixGrow's anti-leak coupons replace the code with the affiliate's link. You set the discount as usual, but no code is created. When a shopper clicks Quinn's link, the discount is applied automatically at checkout and shows in the order summary. Shoppers who arrive any other way don't get it, so there's nothing for coupon sites or extensions to pick up.

Side-by-side comparison. A regular code gets copied to coupon sites and extensions, so you pay a discount and a commission on sales you would have made anyway. An anti-leak coupon has no code, so the discount applies only when a shopper clicks the affiliate's link.

The trade-off is that shoppers have to click the link to get the discount, so it won't work for podcast mentions or word of mouth. Turning it on also hides affiliates' existing codes from their dashboard, and you can't assign new codes while it's on. It suits programs where affiliates share links on social media, blogs and email.

Stop paying commission on leaked codes

BixGrow applies each affiliate's discount through their link, so there's no code for coupon sites or extensions to grab.

Try anti-leak coupons free

Which method works best for different affiliate channels?

The best tracking method for each affiliate channel depends on what the audience does next. People reading on a screen click, so give them a link. People listening, watching or offline remember a code, so give them a code.

ChannelMain methodPair it withWhy
Blogs, review sites & newslettersAffiliate linkCoupon codeReaders click naturally; a code catches those who come back later on another device
YouTubeLink in the descriptionSpoken coupon codeMany viewers never open the description or watch on TV
Facebook & XAffiliate linkCoupon codeLinks in posts are clickable; a code covers video viewers and screenshots shared without the link
Instagram posts & Reels, TikTokCoupon codeLink in bioCaptions aren't clickable, but a code on screen sticks
Instagram StoriesLink stickerCoupon codeThe sticker is tappable, but Stories disappear after 24 hours, so a code helps people who buy later
PinterestAffiliate linkCode on the pin imagePins click through to the product, but people often save them and buy weeks later
WhatsApp & SMSAffiliate linkCoupon codeLinks in messages are tappable; a short code still works when friends pass the tip on in person
PodcastsCoupon codeShort link in show notesListeners hear the code and type it in later
Customer referral programsReferral linkReward code for the friendThe link credits the referrer; the discount gets the friend to order
Events, print & packagingCoupon codeQR code of the affiliate linkNo clicks offline; a QR code turns a scan into a tracked visit

What about UTMs? Add UTM tags to any link in this table to see which channel each visit came from in Google Analytics. They won't change who earns the commission, because the link or code still decides that.

Tip: use links that apply the code automatically. When a shopper clicks, the discount is already in their cart, so nobody forgets to type the code. Shopify can create a shareable link for any discount code that applies it automatically at checkout. BixGrow can also auto-apply an affiliate's code when a shopper arrives through their link.

An order can carry a link click and a coupon code at the same time. The affiliate app still pays one commission, not two, and a priority rule picks who gets it. In BixGrow and many other apps, the code wins, because typing it at checkout is the shopper's last deliberate step. The one exception is a customer already tied to an affiliate for life.

  • Same affiliate: a follower clicks Quinn's link, then types QUINN15 at checkout. Quinn earns one commission, at the code rate if you pay a different rate for code sales.
  • Different affiliates: a shopper clicks Jenna's link but types QUINN15 at checkout. Quinn gets the commission, even though Jenna sent the shopper. This is the most common complaint about mixing links and codes, and it's often a sign that Quinn's code has leaked.

A typical priority order, using BixGrow's as the example:

  1. Lifetime link. A lifetime link ties a customer to the affiliate who referred their first order. After that, every order they place goes to that affiliate, even if they use someone else's code or click another link.
  2. Coupon code. The code beats any link click.
  3. Last link clicked. If the shopper clicked several affiliates' links, the most recent one wins.
Decision flow for an order with both a link and a code. If the customer is tied to an affiliate for life, that affiliate keeps the sale. If not, the code owner gets it. If no code was used, the last affiliate link clicked wins.

Why don't my affiliate app, Shopify and Google Analytics match?

Your affiliate app, Shopify and Google Analytics count different things, so their numbers rarely match.

  • Your affiliate app counts orders credited to an affiliate through a link or code, using its priority rules.
  • Shopify and GA4 credit each order to the source of the shopper's visit. A sale made with a code but no click shows up as direct traffic, even though the app credits the affiliate.
  • GA4 can't see visits from shoppers who decline cookies or block tracking, but the order still appears in Shopify.

Key takeaway

Affiliate links, coupon codes and UTM parameters aren't competing options. Each answers a different question. Links and codes tell you who earned the sale, and UTMs tell you where it came from. Tracking breaks down when you rely on only one of them.

Track every affiliate link and code in one Shopify app

BixGrow credits each order to the right affiliate, whether the shopper clicked a link, typed a code or both, and can keep codes off coupon sites.

Install free on Shopify

FAQs

Can one affiliate have several codes?

Yes. One affiliate can have several codes, which helps you compare campaigns or channels. For example, Quinn could use QUINN15 on Instagram and QUINNPOD on a podcast. Every order with either code is credited to Quinn, and Shopify's Sales by discount codes report shows which one brought in more orders.

In BixGrow, if an affiliate has several codes and you auto-apply codes through links, the first code you assigned is the one applied.

Can I track affiliates on a headless store built with Lovable or Claude?

Yes. A headless store has a custom storefront, while Shopify still runs the products and checkout. Common ways to build one are Shopify's own Hydrogen toolkit, the Vercel Shop template, and AI builders like Lovable or Claude. Shopify lists the main options in its guide to headless commerce.

Coupon codes work automatically, because the code is applied at Shopify checkout. Affiliate links need one extra step: ask BixGrow support for a custom tracking script and add it to your storefront's code. Your checkout must also run on a subdomain of your store, such as checkout.yourstore.com. See BixGrow's guide to tracking on headless Shopify stores.

First click or last click: which is fairer?

Last click credits the affiliate whose link the shopper clicked most recently, so it rewards whoever closed the sale. First click credits the affiliate who introduced the shopper, so it rewards discovery.

Last click is the common default, and it's what BixGrow uses when a shopper clicks several affiliates' links. First click can feel fairer when shoppers take weeks to decide and the first affiliate did the hard work of introducing your brand. Whichever you choose, write it in your program terms so affiliates know the rule before they promote.

Do recurring orders earn commission?

They can. If you sell subscriptions, you decide whether the affiliate who brought in the subscriber earns on renewals too. Common setups are a commission on every renewal, on the first few renewals only, or on the first order only.

Paying on renewals keeps affiliates motivated to bring in subscribers who stay, not just one-time buyers. In BixGrow's order data, recurring orders are credited to the original affiliate.

Share

More articles