"Referral Links vs Referral Codes: Which to Give Customers"

A referral link or a referral code? Where each one wins, the Safari limits that break links, how Stripe codes work and how to stop code leaks.Yash Kapoor · Founder of OpenPromoter · 7 min read

A referral link and a referral code both tell you who sent a customer. The link does it with a click. The code does it with a word the customer types at checkout.

This guide uses Stripe's discount docs and WebKit's tracking prevention notes, both read in November 2026. It also uses the OpenPromoter docs and attribution code. One thing to know first: we make OpenPromoter, and our own product gets one short section near the end.

You get a rule for choosing, the Safari limits that cost links their credit and how a code works in Stripe. You also get the leak risk that most guides skip. For most programs the answer is to offer both.

A referral link is a web address that carries the referrer's ID. A referral code is a short word the customer types into a discount field. The link needs a click and a saved cookie, while the code needs a typed entry and a billing system that reads codes.

Many programs give each referrer one of each, built on the same ID. The link ?via=maya and the code MAYA20 point at the same person.

The difference shows up after the click or the typing. A link depends on the browser to remember the visit. A code depends on the customer to remember the word.

Each one fails in its own way. A link fails when the cookie expires or a visit starts on a phone and ends on a laptop. A code fails when the customer forgets to type it or the checkout has no code field.

Neither one wins in every sales channel. Links win where people can click, such as email, social posts and in-app messages. Codes win where they cannot, such as a podcast, a video voice-over, a live talk or a support call.

Offer both and let the credit rules settle any overlap. A founder who sends a newsletter wants links, because each click is counted per issue. A creator who reads an ad on a podcast wants a code, because listeners will not type a long address.

Referral link vs code by channel for email and social posts or podcast video and events

A link also gives you more data. You see clicks, pages and sub-IDs before anyone pays. A code shows you only the sales.

A referral link depends on a cookie, and browsers shorten how long that cookie lives. Safari deletes cookies written by script after seven days without a visitor interacting with your site. A buyer who clicks today, leaves for a week and returns may carry no trace of the referrer.

WebKit's tracking prevention page lists a "7-Day Cap on All Script-Writeable Storage." That covers cookies written in JavaScript, LocalStorage and IndexedDB. The page also describes a 24-hour limit on script-written cookies in some link-decoration cases.

The same limits came with Intelligent Tracking Prevention 2.3, which WebKit announced on September 23, 2019. Tracking scripts that write their cookie from the page fall under them.

This is our reading of the docs and not a measured loss rate. Still, it explains why a long buying cycle favors a code. A code carries the credit in the customer's own hands.

Note: A link can also work without a cookie if it passes its click ID to checkout. That covers a buyer who pays in the same visit.

How a Referral Code Works in Stripe

In Stripe a referral code is a promotion code. Stripe describes it as a customer-facing code created on top of a coupon. The coupon holds the percent or amount off and the code holds the word that customers type at checkout.

One coupon can back many codes. Each partner can have a code for the same offer. Checkout shows the code box only when you turn on allow_promotion_codes for the session, as the Stripe Checkout discounts docs explain.

A referral code in Stripe: a coupon, a promotion code, a Checkout entry and a credited sale

The same page lets you limit a code to first-time customers. It also supports max_redemptions and an expires_at date.

Say a partner's code MAYA20 sits on a 20% coupon with 100 redemptions and a 90 day expiry. After the hundredth sale, or on day 91, the code stops working.

The docs also say "Checkout Sessions currently support up to one coupon or promotion code." A customer who holds a store-wide coupon cannot also type a partner's code. Decide which offer should win before you launch.

What Is a Referral Promo Code?

A referral promo code is a discount code tied to one referrer. It gives the buyer a price cut and tells you who to credit. A generic code such as WELCOME10 does neither, because anyone can share it and you cannot tell who sent the sale.

Name each code after its owner and keep it easy to say. MAYA20 works on a podcast because listeners can remember it. The trade-off is that it is also easy to guess.

Cap how often each code can be used. The limits above are your guard. A code with no expiry and no cap will still be working a year from now.

Codes also carry a price when they discount the plan. Take a $50 plan sold at 20% off with a 30% commission, which pays $12 and not $15. Decide which base you mean before you promise a rate.

Can a Referral Code Leak to Coupon Sites?

Yes, a referral code is plain text that anyone can post on a coupon site. Shoppers who find it there get the discount, and the partner earns a commission on people they never referred. A link leaves a click trail, but a leaked code leaves none.

The signal is a partner whose sales nearly all come from the code. Say a partner has 10 referrals and 9 used the code with no click. That pattern suggests the code left their audience.

Three steps limit the damage:

  • Cap and expire: Set max_redemptions and an expiry date on every partner code.
  • First-time only: Restrict the code to first-time customers in Stripe.
  • Review the mix: Look at any partner whose sales come mostly from the code.

Our guide to preventing affiliate fraud covers the other schemes.

How OpenPromoter Handles Both

OpenPromoter credits the code first, as install tracking shows. A coupon the customer typed is their own choice and wins over any click. After that it checks the click ID, the partner code in metadata, the visitor's clicks and the lead email.

We make OpenPromoter. Judge this section with that in mind. Four screens cover the setup, and each step links the docs for the click path:

  1. Give a partner a code: Add it on the partner's page. If you enter a Stripe coupon ID, OpenPromoter creates the matching promotion code in Stripe. See partners.
    The Coupon codes card on a partner page with a code, an add field and a Stripe coupon ID field
  2. Let partners share both: The partner portal lists their tracked link and their code on one page. The code card says to use it where links do not work, such as podcasts and video.
    The partner portal Links page with a tracked link and clicks above a coupon code card
  3. Set the cookie window: The window sets how long a click counts. op.js writes its cookie from script. The Safari limits above still apply to it.
    The Tracking card with the cookie window and credit goes to settings
  4. Watch for leaks: The Fraud page checks for coupon leaking. It flags a partner when at least 80% of 5 or more referrals used the code with no click. See fraud.
    The Fraud page What we check list with Coupon leaking among the checks

Tip: On Paddle the webhook names a discount by its ID and leaves out its code. Add the ID that starts with dsc_ as the partner's coupon code. See billing providers.

A coupon-leak flag scores 45 and commissions are held at 70 or more. The flag alone does not hold pay. Our affiliate tracking page lists the rest of the tracking features.

Conclusion

A referral link wins where people click and gives you click data. A referral code wins where they cannot click and survives a browser that forgets the visit. Most SaaS programs should offer both.

Set limits on every code before you share it. Cap redemptions and set an expiry. Check that your billing system passes the code to your tracking tool.

Then watch the share of sales that come from codes alone. A partner with nearly all sales from a code deserves a closer look. If you are weighing a customer program, read our SaaS referral program guide next.

All posts

[ openpromoter ]

Try it with your own Stripe account

Free on Cloud up to $1k a month in partner revenue or free forever on your own server.