Store promotions · 21 Nov 2026 · 5 min read
Ecommerce discount codes: how to set rules that do not backfire
A discount code is a small piece of logic with a big effect on margin. The rules around it decide whether it wins you new customers or simply gives money to people who would have bought anyway.
The short answer
Set discount codes with a clear purpose, a defined audience, an end date and a usage limit. Decide in advance whether codes can stack with other offers, exclude items where margins are thin, and track orders with and without the code so you can see whether it added sales or just reduced price.
Start with the purpose of the code
Before choosing a percentage or a rule, name the job. Discount codes are used for several different things, and the right rule changes with each.
- Welcome offers to turn a first-time visitor into a customer.
- Win-back codes for lapsed customers.
- Recovery of abandoned baskets.
- Clearing old or discontinued stock.
- Partner, influencer or affiliate codes used to see where sales came from.
- Trade or wholesale terms, which are better handled as a customer group than as a public code.
A code with no stated purpose tends to run forever, and a code that runs forever becomes the price. Write the purpose, the audience and the end date in one line and keep it with the setup.
It also helps to decide who owns the code. One person should be able to say why it exists, when it ends and who may switch it off. Without an owner, expired offers linger in emails, on partner pages and in old social posts, and customers keep trying them at checkout.
How to stop codes being shared widely
Once a code is on a coupon site or in a forum, you cannot call it back. The only defence is to design codes so that sharing causes limited damage. Start with the audience.
- Use single-use codes that are generated per person and sent by email, rather than one public code.
- Tie a code to a customer account or an email address where your platform allows it.
- Set a total usage cap and a per-customer limit.
- Put an expiry date on every code.
- Use a minimum basket value when the offer would otherwise lose money on small orders.
Be aware that a prompt asking "Have a code?" at checkout sends some shoppers off to search for one. If you rely on a visible code box, expect some of them to leave and return with a code they found elsewhere. Some stores collapse the field behind a link for that reason, but check that doing so does not confuse shoppers who do have a code.
Should codes stack?
The safest default is no. If a customer can combine a welcome code, a sale price, free delivery and a partner code, the final price may be lower than you ever intended. Most store platforms let you choose whether a code combines with other discounts, and the options differ, so check the current documentation of your platform.
| Situation | Suggested rule |
|---|---|
| Item already on sale | Exclude from codes, or allow only one reduction |
| Free delivery offer plus percentage code | Decide which wins and state it before checkout |
| Partner code plus welcome code | Allow one code per order |
| Trade pricing | Keep outside the public code system |
Whatever you choose, show the rule where the shopper can see it. An error message that says only "code invalid" sends people to customer service. Say why: "This code cannot be used with sale items" is clear and ends the conversation.
Protect margins and avoid training shoppers to wait
Constant discounting teaches customers that the list price is a starting point. If every email carries a code, many shoppers will learn to wait for one. That is the most common way a discount code backfires.
Use codes for a reason and a time, and keep the rest of the year clean. Know your margin on each product before you exclude or include it. Where margins are thin, exclude the item rather than hoping volume will make up the difference. When setting prices in the first place, the thinking in how to price products for an online store helps you see how much room a code actually has.
Also consider alternatives that do not cut the price: a free gift, free delivery above a basket value, or a bundle. Each has its own cost, but they can protect the perceived value of the main product.
Codes for trade and wholesale customers
A public code is a poor tool for business buyers. Trade customers expect consistent terms, not a code they need to remember. If you sell to both consumers and businesses, set up a separate pricing route or customer group where the trade terms apply automatically after login. Our guide to wholesale and trade ordering basics covers how that works.
Keep the rules for trade accounts apart from consumer codes so a trade price never leaks into a public promotion.
Does the platform change the rules you can set?
Yes, and by more than most owners expect. Hosted platforms and custom builds differ in how they handle stacking, per-customer limits, automatic discounts, exclusions and reporting. A rule you need may be easy in one setup and require custom work in another. The trade-offs are described in our comparison of a custom ecommerce website and Shopify.
List the rules you want first, then check which are supported. If the platform cannot enforce a rule, do not announce it.
How to measure whether a code worked
The question is not "how many orders used the code" but "how many orders did we get that we would not have had anyway". Those are different numbers.
- Record the baseline: orders, average basket and margin in the weeks before the code.
- Compare against the same period with the code, ideally with a holdout group that did not receive it.
- Look at margin per order after the discount, revenue alone.
- Check whether sales dropped after the code ended, which suggests you pulled demand forward.
- For partner codes, look at whether new customers came in or existing customers simply used the code.
A small test is better than none. If you email a code to half of a list and keep the other half as a comparison, you can see the difference directly. Keep a note of each test so you do not repeat a code that did not work.
Support, search and the wider store
Discount rules generate questions, so publish the conditions in a place customers can find them. Our guide to help centre and contact options shows how to answer them before they reach your inbox.
Do not index temporary code pages as if they were permanent content, and avoid showing an expired offer in search results. The basics in search visibility for new stores help you keep promotion pages tidy.
If you need a store where discount rules, customer groups and reporting are set up to match how you sell, see the ecommerce solutions page from Liftup Technologies.
Related guides
- Ecommerce solutions
- Icon design for brands style rules that keep sets consistent
- B2b ecommerce wholesale and trade ordering basics
- Custom ecommerce website vs shopify
- Ecommerce Customer Service Pages: Help Centre and Contact Options
- New Store Visibility: The First 90 Days
Questions and answers
How do I stop codes being shared widely?
Use single-use or per-customer codes, set a total usage cap and an expiry date, and consider a minimum basket value. A single public code posted on a coupon site cannot be recalled, so design codes so that sharing costs you little.
Should codes stack?
Not by default. Allowing several offers to combine can push the price below what you intended. Decide on one rule, such as one code per order, check what your platform supports, and tell shoppers the rule at the point where they enter the code.
How do I measure whether a code worked?
Compare orders and margin against a baseline period or a holdout group that did not get the code. Look at margin after the discount, revenue alone, and check whether sales fell after the code ended. A code used by customers who would have bought anyway has not added much.
Is it better to give a percentage or a fixed amount?
It depends on your products and margins. A percentage scales with the basket, while a fixed amount is easier to control on low-margin or high-value items. Test one against the other and compare margin per order.
Do discount codes hurt brand perception?
They can if they are constant, because shoppers learn to wait for them. Use codes for a stated reason and a limited time, and consider alternatives such as free delivery above a basket value or a gift with purchase.
Tell us what you are building.
A short call, a written plan and a fixed quote. No obligation.