> For the complete documentation index, see [llms.txt](https://docs.wandreferrals.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wandreferrals.com/tracking-and-attribution/coupon-vs-link.md).

# Coupon versus link tracking

## What it does

Affiliates can drive sales two ways, and both are tracked:

* **Coupon (discount code)** — the affiliate shares a unique discount code; when a buyer uses it at checkout, the order is credited to that affiliate. Coupon is the **highest-priority** attribution signal.
* **Referral link** — the affiliate shares a tracking link; a click sets a cookie, and an order within the cookie window is credited. Links are attributed by direct-link ref or by the link cookie.

Most programs use both. A coupon always wins over a link if an order has both signals (see [How attribution works](https://github.com/wand-referrals-app/wand-referrals/tree/codex/gitbook-docs-foundation/docs/manual/attribution/how-attribution-works/README.md)).

## Coupons (discount codes)

* Each affiliate gets a unique code. Codes are **max 9 characters** and never contain the ambiguous characters `0`, `o`, or `O`.
* A code can be auto-generated when an affiliate is approved, or you can assign a custom one.
* When an affiliate is approved/activated, Wand Referrals can create the matching discount in Shopify and keep it in sync.
* Configure discount value/type and coupon behavior in the program's discount settings, and in **Settings → Link & Coupon**.

## Referral links

* Each affiliate has a referral link (and slug). Sharing it and getting a click sets the tracking cookie.
* The affiliate portal's **Links & coupons** page lets affiliates copy their link and code, and build custom deep links and UTM-tagged links.
* A short click-redirect URL (`/apps/affiliate/click/<code>`) records the click and forwards the shopper to your store with the discount applied.

## The cookie window

Link/cookie attribution only counts within the program's **cookie duration** (default 30 days). After that window, a cookie no longer wins. Coupons are not time-limited by the cookie window — a coupon used at checkout is attributed whenever it's used.

## Anti-leak discounts

To stop affiliate codes from leaking onto public coupon sites, a program can enable **anti-leak discount** rules. These are enforced at checkout by the discount function, not by the commission engine. See [Settings overview](https://github.com/wand-referrals-app/wand-referrals/tree/codex/gitbook-docs-foundation/docs/manual/settings/settings-overview/README.md).

## Related

* [How attribution works](https://github.com/wand-referrals-app/wand-referrals/tree/codex/gitbook-docs-foundation/docs/manual/attribution/how-attribution-works/README.md)
* [Connected customers & products](https://github.com/wand-referrals-app/wand-referrals/tree/codex/gitbook-docs-foundation/docs/manual/attribution/connected-customers-and-products/README.md)
* [Getting your link & coupon (affiliate)](https://github.com/wand-referrals-app/wand-referrals/tree/codex/gitbook-docs-foundation/docs/manual/portal/getting-your-link-and-coupon/README.md)
