Coupon Code Tracking
Coupon-code tracking is the fallback and the friend of referral-link tracking. It does not depend on cookies, devices, or clicks — it only needs the shopper to type the code at checkout.
The flow
- Merchant creates a program with a customer discount.
- Coupon code (e.g.
SARAH10) is generated and tied to an affiliate. - Affiliate shares the code on TikTok, Instagram, podcast, anywhere.
- Shopper types
SARAH10at checkout, gets the discount, completes the order. - Shopify sends an
orders/createwebhook. - The app reads the order's
discount_codes[]array. - The first code that matches a known affiliate wins. Conversion is created for that affiliate.
Why coupon tracking is so valuable
- Works on any device — cookies don't matter.
- Works across sessions — visitor doesn't need a fresh click.
- Works even without internet tracking — works when the customer pastes a code heard on a podcast.
- Not blocked by ad blockers — the code is on the order, nothing to block.
Recommendation: give every affiliate both a link and a coupon. The coupon catches the sales the link misses.
Coupon priority
Coupon beats referral link. If an order has both a click cookie and a matching coupon:
- If the coupon belongs to a different affiliate than the cookie → coupon wins.
- If the coupon belongs to the same affiliate as the cookie → still counts as one conversion (no double commission).
This is the industry standard. The assumption: a typed coupon shows more intent than a passive click.
Coupon format
| Rule | Detail |
|---|---|
| Characters allowed | Uppercase A-Z, 0-9, hyphens. |
| Max length | 50 characters. |
| Case | Case-insensitive at checkout (customer can type lower or upper). |
| Uniqueness | A code can be tied to only one affiliate per shop. |
Variable substitution at creation time
Merchants set a Coupon code format template on the program's Discount tab. When the toggle is on, the app generates one code per affiliate using the template:
| Variable | Example |
|---|---|
{full_name} | SARAHSMITH |
{first_name} | SARAH |
{random_number} | X7K2 (random 4-character string) |
The default template is {full_name}-{random_number} → e.g. SARAHSMITH-X7K2. Other allowed characters in the template: letters (A–Z), numbers (0–9), hyphen, underscore.
If a generated code happens to collide with one that already exists in the store, the system appends another random suffix automatically.
Commission on coupon orders
Commission is calculated after the coupon discount:
- Order subtotal = $100.
- Coupon: 10% off → discounted subtotal = $90.
- Program commission: 15%.
- Affiliate earns: 15% × $90 = $13.50.
Not 15% × $100. This protects the merchant's margin — you don't pay commission on money you didn't collect.
If the shopper uses multiple codes
Shopify typically restricts orders to one discount code, but in edge cases (e.g. stacked promotional codes), multiple may appear in discount_codes[]. The app takes the first code that matches a known affiliate. Others are ignored.
If the code doesn't match any affiliate
The order is treated as a normal (non-referral) order. No conversion is created. The shopper still gets the discount; no one earns commission.
Coupon fraud
Common pattern: an affiliate uses their own code on their own purchase.
- Self-referral fraud is hard to detect automatically — the order looks normal.
- Best defense: look at the order's email when reviewing. If it matches the affiliate's email, deny the conversion.
- Policy: state in your affiliate agreement that self-referral is not allowed. Some merchants deny all first-purchase coupons from new affiliates as a precaution.