What It Is
Customers who arrive via a creator link shouldn’t lose their discount. Maintained discount protection ensures the code persists across sessions, page navigations, and checkout flows.Enable Safe Discount Codes in Settings → Discount Settings to protect your base discount codes from coupon scrapers while providing unique codes per checkout.
Key Capabilities
- Session persistence — Discount survives page refreshes
- Cross-device hints — Email links include discount
- Auto-application — Code applied at checkout automatically
- Stacking rules — Define how creator discounts interact with promos
- Expiration handling — Graceful fallback when codes expire
- Safe discount codes — Unique codes per checkout protect base discounts
Safe Discount Codes
Location: Settings → Discount Settings → Enable Safe Discount Codes What it does:- Creates a unique, safe discount code every time someone clicks a creator link and starts checkout
- Base discount code (e.g.,
CREATOR20) remains safe and not exposed to coupon code tools - Cloned codes are unique per checkout session
- Base discount stays protected from coupon code scrapers
- Customer clicks creator link
- When checkout starts, a cloned discount is auto-generated
- The cloned code is unique (includes random number)
- Base discount remains protected
- Use
{FIRSTNAME},{LASTNAME},{DISCOUNT}variables - Example:
{FIRSTNAME}{DISCOUNT}→SARAH20+ random →SARAH201234 - Random number always appended for uniqueness
- You want to protect base discount codes from coupon scrapers
- You need unique codes per checkout for tracking
- You’re not using an affiliate platform that already handles this
- You’re using an affiliate platform with built-in discount protection
- You want to use the base discount code directly
- You have custom discount management logic
Initial Settings Guide
Complete guide to configuring safe discount codes and discount settings
Protection Layers
| Layer | Method | Persistence |
|---|---|---|
| URL parameter | ?discount=CODE | Single page |
| Cart attributes | cc-discount-code | Cart session |
| Local storage | cc_discount_code | 30 days |
| Checkout URL | /checkout?discount=CODE | Checkout |
| Email links | Pre-applied in URLs | Per-click |
Implementation
Checkout Auto-Apply
Edge Cases Handled
| Scenario | Solution |
|---|---|
| Customer clears cookies | Email links restore discount |
| Code expires mid-session | Show notification + alternative |
| Multiple codes entered | Last code wins or best-of |
| Checkout timeout | Discount re-applied on return |
How This Connects
- Discount protection is a reliability layer that supports attribution accuracy, creator trust, and consistent shopper UX.
- It works in tandem with Co-branded Carts & Checkout and Shopify-native Attribution by preserving creator context through conversion.
Related
- How Features Connect — System-level map of feature dependencies
- Initial Settings — Configure safe discount codes and templates
- Support Unique Discounts — Technical implementation
- Show Discounted Prices — Display discounted prices in theme
- Discount Code Management — Auto-creation workflows