← All docs

Links and discount codes

An affiliate can share four kinds of link and one discount code:

That split is the distinction that matters most: a link is credited by the click Sprout Affiliate records, a code by what the buyer types at checkout. The two easiest to mix up are the link builder (section 2 below) and the personal link ending (section 3 below), because both are Professional switches sitting one above the other in the same settings card.

What an affiliate builds in their portal
Page on your store
/products/kodak-capture-one
Where you will post it
youtube

Gives them:
yourstore.com/products/kodak-capture-one?ref=nicklaus&ref_source=youtube

The tag is what lets Analytics tell you which of their posts actually sells.

Every affiliate gets one, on every plan, with no setting to switch on. It looks like https://yourstore.com/?ref=k7m2p9xd.

The ?ref= part is the affiliate's link name. Sprout Affiliate generates it as eight random lowercase letters and digits on purpose: a ?ref= value is public, so an affiliate's real name has no business being in it.

It is not fixed forever. When an affiliate gets a personal link ending (section 3), the app renames the ?ref= link name to match it, so /sarah and ?ref=sarah stay one name rather than two to keep track of. You can also rename it yourself from their profile.

Renaming never costs anyone a sale. The old value is kept as an alias and goes on crediting the same affiliate, so a link already sitting in a year-old video description keeps earning. That is deliberate: an affiliate's links live in places neither of you can edit.

If the affiliate's program applies the discount through the link instead of a code, the link is https://yourstore.com/discount/THEIRCODE?redirect=/?ref=k7m2p9xd. Shopify applies the code, then sends the shopper on to the tracked URL.

UTM tags, and whether you need them

A UTM tag is an extra piece of a web address that tells your analytics tool where a visit came from. They are a Google Analytics convention, not a Shopify or Sprout Affiliate one, and they look like this on the end of a link:

?ref=sarah&utm_source=affiliate&utm_medium=referral&utm_campaign=affiliate-program

You set one value for each, under Settings › Links & coupons, and every affiliate link carries that same set. That is the point of them: they label the channel, so all affiliate traffic collapses into one line in your reports that you can compare against email, paid, and organic. They are not a per-affiliate or per-post tag, and they are not meant to change from one affiliate to the next.

Each is cut to 60 characters, and anything other than letters, numbers, underscores, dots, hyphens, and spaces is stripped.

Where an affiliate actually posted a link is a different tag. That one is ref_source, the affiliate sets it themselves in the link builder (section 2), and it changes from one link to the next: youtube on the video, newsletter in the email. UTM tags never carry it. If what you want is "which of Sarah's posts sold this", that is ref_source, and it shows on the referral order and in Analytics.

They change nothing about commission. Sprout Affiliate credits the sale from ?ref=, and ignores UTM tags entirely. They exist so affiliate traffic shows up as its own line in Google Analytics or your Shopify reports instead of being lumped in with everything else. If you do not use an analytics tool that reads them, leave all three blank.

Attribution runs through a Web Pixel, which is a small piece of tracking code Shopify runs on your storefront and checkout pages. Sprout Affiliate installs its own, so there is nothing for you to add. When a shopper lands on any page carrying ?ref=, the pixel saves that value in the shopper's own browser along with the time of the click.

At checkout it sends both to Sprout Affiliate. If you also switch on the app embed (the Sprout referral tracking block, under App embeds in your theme editor), the same click is written to the cart as a Sprout Ref attribute, so the referral is recorded on the order itself as a second piece of evidence.

The click also has to be recent enough, or the referral is dropped. How recent is set by the Cookie duration (days) field on each program, 30 days by default: a click older than that when the order is placed earns nothing. Ticking Infinite cookie duration on a program means a click never runs out.

Plan: Professional. Off by default. Turn it on at Settings > Links & coupons > "Link builder: link to any page, and tag where it was posted".

The affiliate then sees a Build a link card on their dashboard (and in the iPhone app) with two fields.

  1. Where it goes. They paste any page of your store (a product, a collection, a blog post). Leaving it blank means your home page. The app rebuilds the URL against your store's own domain, so a shopper is not sent through your .myshopify.com address on the way, and adds their ?ref= plus your UTMs. A URL that does not point at your store is refused when they try to save it.
  2. Source (optional). A short channel tag such as youtube, instagram or newsletter. Anything that is not a letter, number, underscore, or hyphen is stripped, and it is cut to 40 characters. It goes on the link as ref_source=youtube.

The pixel stores the source tag alongside the referral, so a shopper who clicks a tagged link and buys three days later is still tagged to that channel. Each affiliate can keep up to 50 saved links, so they can come back for the exact URL they put in a video description months ago.

The tag then appears in two places. On Referrals > the order, the Source card shows "Channel tag: youtube". In the affiliate's own referrals table, a Source column appears, but only once at least one of their orders actually carries a tag, so an affiliate who never tags anything never sees an empty column.

Limitations worth knowing. Source tags are recorded per order. There is no report that totals sales by tag, so comparing channels means reading the orders. Tags also only exist on orders the pixel reported: an order attributed by discount code alone has no tag.

Plan: Professional. Off by default. Turn it on at Settings > Links & coupons > "Personal link ending, instead of a ?ref= link".

A personal link ending gives an affiliate https://yourstore.com/nicklaus. Behind it is one Shopify URL redirect (the same kind you can make by hand under Online Store › Navigation › URL Redirects), created by the app and pointing at exactly the same ?ref= destination the plain link uses.

Attribution is identical. Only the URL is prettier. It works this way because Shopify does not let an app answer a web address at the top level of your domain, and a URL redirect is the one mechanism that can.

The request and approve flow. The affiliate types the ending in their portal, under "Add custom link". By default nothing goes live: the request lands on their profile at Affiliates > their name, in a banner with Approve and Decline. Approving publishes it. You can also just type an ending on their profile yourself and press Save.

Auto-approve. The sub-setting "Approve custom links automatically" makes their button say Save instead of Request, and the link publishes immediately. A program can override the shop setting, and a single affiliate can be overridden again on their profile ("Goes live instantly" or "Always review it first"). Every validation still applies either way.

An ending is refused if it is shorter than two characters, is all digits, is one of the 23 reserved storefront words (products, collections, pages, blogs, cart, checkout, account, apps, a, admin, search, discount, orders, policies, tools, services, password, challenge, customer_authentication, wpm, cdn, sitemap.xml, robots.txt), is already held by another affiliate's live link or pending request, or already exists as a redirect in your store that Sprout Affiliate did not create.

What they type is lowercased, spaces become hyphens, anything other than letters, numbers, dots, underscores, and hyphens is dropped, and the result is cut to 60 characters. Affiliates get a deliberately vague "Pick another" so they cannot map out who holds what; you get the specific reason. When an ending publishes immediately, the affiliate waits ten seconds before saving again, whether or not Shopify accepted the change, because those writes come out of the same allowance of Shopify admin requests that order tracking and discount creation use. A typo, or an ending someone else already holds, is refused before that clock starts, so it costs nothing.

The checkbox "Let this affiliate request their own custom link" on a profile is a hard off for that person, and turning it off withdraws any request they have pending.

Why an old ending keeps working. When an affiliate changes their ending, the old redirect is not retargeted or deleted. It stays live, still pointing at their ?ref= destination, so the link already sitting in a video description or a bio keeps working and keeps earning them commission. Up to ten retired endings are kept per affiliate; past that the oldest is deleted, on the assumption that a link shared years ago is the least likely to still be selling. Removing an affiliate's custom link removes the live ending and every retired one.

Publishing an ending also renames the affiliate's ?ref= link name to match, where that name is free, so there is only one name to maintain. Their old link name is kept as an alias, which means it still credits them, so any link already in the wild carrying it goes on earning. If someone else later takes a name that is still an alias, the live affiliate wins, so old clicks can never be handed to a new person by accident.

Limitations. If you delete the redirect by hand in Shopify, re-saving the same ending repairs it. If you downgrade below Professional, existing endings keep redirecting, but affiliate saves quietly fall back to filing a request, and approving one is refused until you upgrade again.

Plan: Professional. Off by default. Turn it on at Settings > Links & coupons > "Short branded referral links".

The affiliate's dashboard then shows https://app.sproutaffiliate.com/r/ab3kx9m as their link to copy. Each affiliate gets one seven-character code, created the first time they need it, drawn from a 32-character set that leaves out 0, o, 1 and l so it can be read aloud without confusion.

Opening it is a redirect to your store's home page with their ?ref= and your UTM tags attached. That has three consequences:

If the short link cannot be created, the affiliate is shown their full link instead. After a downgrade the dashboard goes back to the full link, but short links already shared keep redirecting.

5. Discount codes

Codes are available on every plan. On a program, Offer a customer discount turns them on, and How customers get it chooses between "Discount code" and "Auto-applied by the affiliate's link". With the discount unchecked the program is link-only and hands out no coupons at all. In link mode the affiliate still has a code, it is just applied by the URL rather than typed by the shopper.

Where an affiliate's first code comes from. The signup form never asks an applicant for a code. On Free and Growth, an affiliate you approve starts with none: they set one in their portal or the iPhone app, or you assign one on their profile with Assign coupon, and the Shopify discount is created at that moment. On Professional and Enterprise, approving an application yourself (one at a time or in bulk) creates a code for them from their first name, SARAH, then SARAH2 if that is taken, as long as their program offers a discount above 0%. A program that approves signups automatically does not create one.

Code rules. Uppercase letters, numbers, and hyphens, 3 to 20 characters. Other characters are stripped as you type it. A code must be unique across every primary code and extra coupon in your store.

If the code already exists in your Shopify discounts and Sprout Affiliate did not create it, the request is refused, and the message names the code and tells you to delete that discount under Discounts or pick another. That is deliberate: adopting your own public sale code would let an affiliate claim commission on it.

Review first. A program can turn on "Review codes before they go live". The affiliate's request lands on their profile with Approve and Decline, and their current code keeps working until you decide.

Extra coupons. On a profile, "Let this affiliate create their own coupons" plus a Coupon limit sets how many they may create (1 by default). You can also assign coupons to them yourself.

Removing a coupon behaves differently depending on who does it. When you remove one from a profile, the app deactivates its Shopify discount too, so it stops giving money away with nobody credited, and it tells you if the deactivation failed so you can do it under Discounts. When the affiliate removes one of their own from the portal, the Shopify discount stays live in your store until you delete it there. In both cases the orders already placed with it are pinned, so those stay credited.

Product scope. On a profile, Coupon products limits that one affiliate's coupons to chosen products or collections; leaving it empty follows the program's scope. Changing the scope only affects codes created from then on. Existing Shopify discounts keep the scope they were made with, like any other discount setting.

6. Your own domain

Plan: Professional. Off by default. Set it up at Settings > Links & coupons > Your own domain.

Three pages are shown to your affiliates rather than to you: the signup form they apply through, the login page, and the portal where they get their link and watch what they have earned. All three are served by Sprout Affiliate, so by default they sit on app.sproutaffiliate.com. Point a subdomain you own at us and they move to it.

The same three pages, before and after
PageDefaultOn your domain
Signupapp.sproutaffiliate.com/join/yourstoreaffiliates.yourstore.com
Loginapp.sproutaffiliate.com/affiliate/loginaffiliates.yourstore.com/affiliate/login
Short linkapp.sproutaffiliate.com/r/ab3kx9maffiliates.yourstore.com/r/ab3kx9m

The bare hostname works as the signup link, so what you hand out is affiliates.yourstore.com and nothing more.

Setting it up

  1. Pick a subdomain of a domain you already own. affiliates.yourstore.com and partners.yourstore.com are the usual choices.
  2. Type it into Settings > Links & coupons > Your own domain and press Add domain.
  3. The page then shows a DNS record. Add it wherever your domain's DNS lives, which is your registrar unless you moved it somewhere else.
  4. Press Check again. If DNS has not spread yet, wait and press it again; you do not have to stay on the page, because Sprout Affiliate re-checks every hour on its own and switches the domain on the moment it is ready.
The record to add
Type
CNAME
Name
affiliates
Value
sprout-affiliate.fly.dev

Some DNS panels call Name the "host" and Value the "target", "points to" or "data". A few want the full affiliates.yourstore.com in Name rather than just affiliates.

Why it has to be a subdomain

Your main domain already points at Shopify, because that is what serves your storefront. A CNAME cannot sit alongside the records a domain's root needs, so pointing yourstore.com itself here would take your shop offline. Sprout Affiliate refuses a bare domain for that reason.

What happens between adding it and it going live

Nothing changes for anyone. The domain reads Not ready, and every link keeps using app.sproutaffiliate.com, so a half-finished setup cannot break a signup page or strand an affiliate. Two things have to finish first:

What moves to your domain

Referral links themselves are unaffected. Those already point at your storefront, which was never on our domain: yourstore.com/?ref=sarah looks the same either way.

The marketplace stays on app.sproutaffiliate.com. It is one directory shared by every store in it, so it cannot be served under any single one.

Changing or removing it

Remove puts every link back on app.sproutaffiliate.com straight away. Links you already gave out keep working either way, so an affiliate holding an old one is never stranded, and you can take the DNS record down afterwards. Adding a different domain replaces the first and releases its certificate.

Removing is never blocked by your plan. If you drop below Professional the domain keeps serving, but you will not be able to change it until you are back on a plan that includes it.

One store per hostname. A domain already in use by another store is refused. If you run several stores, give each one its own subdomain.
Discount codeReferral link
EvidenceThe code on the orderThe click, reported by the pixel or carried on the cart
Time windowNone. Whenever it is used, it creditsThe program's cookie duration (30 days by default)
Survives the shopper clearing their browser storageYesNo
Carries a source tagNoYes, if the link was tagged

When an order has both, the code wins. The exception is anti-leak discount protection (Professional, off by default, under Settings > Fraud detection). With it on, a code alone earns nothing: if the click names a different affiliate, the click is trusted, and if there is no click at all, nobody is paid. That is what stops a code posted to a coupon site from paying an affiliate who did not send the customer.

Changing a code never breaks history, but it does leave the old code live in your Shopify discounts. Orders already placed with the old code stay credited to the affiliate. The old code goes on working at checkout, and because it no longer belongs to anyone in Sprout Affiliate, orders that use it from then on give the customer the discount and credit nobody. Delete it under Discounts once you no longer want it redeemable.