Harmonia

How to Track Affiliate Sales Without Discount Codes (2026)

The Harmonia teamMay 27, 20268 min read

The short version

You can track affiliate sales without discount codes by reading a first-party signal inside your own Shopify store, not by asking the shopper to type anything. When someone clicks an athlete's tracking link and buys, a ?ref= value is written into your Shopify cart attribute, and the order is matched to the athlete on our server. The shopper enters no code and sees nothing different. You keep full price on every credited sale.

That is the whole differentiator: credit lands from your order data, so it holds even when the browser drops the trail.

$0customer discount needed to credit a sale

Why discount codes became the default, and why premium brands reject them

A coupon code is the legacy way to credit an affiliate. The shopper types a code at checkout, the network reads the code, and the sale is attributed. It is simple to set up, which is why most older networks lean on it. The problem is what the code costs you.

A coupon does two things to a premium brand, and both lose money:

  • Every redemption discounts the order. The discount is the tracking method, so you pay it on every attributed sale. You never keep full price.
  • The code spreads where you never approved it. Codes get copied into forums and coupon aggregators. Once a code is on a deal site, anyone can skim the discount, and shoppers learn to abandon the cart and hunt for a code before buying.

For a brand like Kane, Huel, or Patagonia, the second point is the dealbreaker. The price is part of the brand. Training buyers to wait for a code, and letting a discount leak onto deal sites, erodes the exact pricing the brand equity rests on. A code also misses every shopper who never had one or forgot to enter it, so it under-credits the athletes who actually drove the sale.

The modern browser made codes weaker on the technical side too. Many older programs paired the code with a third-party cookie to catch shoppers who did not type anything. Safari's tracking protection (ITP) and ad blockers now break that cookie, so credit goes missing.

The mechanism: a ?ref= value written into the Shopify cart attribute

Harmonia credits the sale from a value stored in your own order, not from a code the shopper remembers. An unlisted custom Shopify app does two things on your store, and nothing else:

  • Injects a small script that writes ?ref= into the cart attribute. When a shopper arrives from a tracking link, the script reads the ?ref= value from the URL and copies it into the order's cart attribute, a hidden field Shopify carries through to the finished order.
  • Registers the orders/create webhook. Shopify notifies Harmonia the moment an order is placed, and sends us the order, including its cart attributes.

The shopper never sees the ?ref= value. There is no code field, no banner, no extra step. They click a link, shop, and check out at full price.

What the shopper does

Nothing different. They click a link, shop, and buy at full price. There is no code to enter, remember, or share. The whole mechanism lives in your order data, invisible to them.

Server-side matching: the orders/create webhook, not the browser

The match runs on our server, not in the shopper's browser. This is what makes it first-party attribution. Here is the full path, from a click to a credited sale:

  1. Click. The shopper clicks an athlete's tracking link, which carries a ?ref= value that identifies the athlete.
  2. Capture. The injected script reads ?ref= from the URL and writes it into your Shopify cart attribute.
  3. Checkout. The shopper buys at full price. Nothing for them to enter.
  4. Webhook. Shopify fires the orders/create webhook to Harmonia and sends the order, including its cart attributes.
  5. Match. We read the ?ref= value from the order and credit the athlete who drove the sale, all on our server.
  6. Window check. If the purchase falls inside your attribution window, commission accrues to that athlete. Outside it, the sale counts as organic and costs nothing.

Because the match happens server-side from your order data, it does not depend on the shopper's browser, cookies, or any pixel. For the install and the self-test that confirms the script is writing the cart attribute, see installing the Shopify app.

You pay only on a real attributed sale

You pay the commission you set, plus a 20% platform fee on top, billed to you, only when an athlete drives a real attributed sale. The fee is never deducted from the athlete. Nothing is charged on an organic sale or an unattributed one.

One tracking link per program: QR codes and anchor tags preserve the same ?ref=

The tracking link is per program, meaning one link per brand relationship, not one link per product. That single link carries the same ?ref= attribution to any product the shopper buys in your store, so an athlete never manages a separate link for every item.

The same ?ref= attribution travels through:

  • A QR code that resolves to the tracking link.
  • An anchor tag that points the link at a specific landing page or product.
  • Any product the shopper ends up buying in your store within the attribution window.

In every case the ?ref= value is written to the cart attribute the same way, and the match still happens on our server. For a brand, that is one link to share and one source of truth for credit.

The result: attribution that survives ad blockers, ITP, and browser switching

Because the ?ref= value lives in your store's own order, not in a third-party cookie or a shopper-visible pixel, the attribution holds where browser-based tracking fails:

  • Ad blockers. Nothing on the shopper's side to block. The value is in your order data, matched on our server.
  • Safari tracking protection (ITP). ITP caps and clears third-party cookies. There is no third-party cookie here, so there is nothing to clear.
  • Browser switching. A shopper can click on a phone and buy on a laptop. The credit still lands, because it rides in the cart attribute and is matched server-side, as long as the purchase falls inside the attribution window.

And it does all of that with zero discounting. The shopper pays your list price, no redemption comes off the order, and the right athlete is still credited.

Legacy affiliate networksHarmonia
What credits the saleA discount code or a third-party cookieA first-party ?ref= cart attribute
Where the match happensIn the shopper's browserOn our server, from the orders/create webhook
Effect on your priceEach redemption discounts the orderFull price kept on every sale
Holds under ad blockers and Safari ITPOften notYes
What the shopper doesEnters or remembers a codeNothing

For the deeper model and why it beats discount-code programs, see attribution without discount codes.

How the money works once a sale is credited

When a real attributed sale lands, the athlete earns the commission you set, in full. You set the commission per program, either a flat dollar amount or a flat percentage. Here is the model in plain numbers, using a $50 commission as an example:

ItemAmount
Commission you set (example)$50 per sale
Athlete receives$50athlete keeps, in full
20% platform fee, on top, billed to you$10
Your total cost$60

The 20% platform fee is added on top and billed to you, never deducted from the athlete. The fee is charged only when an athlete drives a real attributed sale. We invoice you monthly via Stripe Billing, net-30, on the 1st of the following month: the commission your athletes earned plus the 20% platform fee. Athletes are paid from the cleared commission once your invoice clears.

FAQ

Can I run an affiliate program without giving out discount codes?

Yes. Harmonia credits sales from a first-party ?ref= value written into your Shopify cart attribute and matched on our server, not from a coupon. There is no code to give out, expire, or leak to a deal site. You keep full price on every credited sale, and you pay the commission you set plus a 20% platform fee on top, billed to you, only on a real attributed sale.

How does Harmonia know which athlete drove a sale if there's no code?

When a shopper clicks an athlete's tracking link, an injected script writes the link's ?ref= value into your Shopify cart attribute. The value rides through to the finished order. When the order is placed, Shopify fires the orders/create webhook to Harmonia, and we read the ?ref= value from the order to credit the athlete who drove the sale. The match runs on our server, so it does not depend on the shopper entering anything.

Does first-party attribution still work if the shopper uses an ad blocker?

Yes. An ad blocker blocks third-party scripts and trackers in the shopper's browser. There is nothing for it to block here, because the ?ref= value lives in your own order data and the match happens on our server from the orders/create webhook. The same holds under Safari tracking protection (ITP) and when a shopper switches devices between the click and the purchase, as long as the sale falls inside the attribution window.

The Harmonia team Notes from the team building the US Health & Wellness partner platform.

← All posts