If your free gift is still free after a shopper removes the qualifying product, the cause is almost always the same: the gift logic runs only in the browser. Storefront JavaScript watches the cart, adds the gift when the threshold is met, and prices it at zero. But the cart is a dynamic object. Once the gift has attached, a shopper can remove the qualifying item and — if nothing re-checks eligibility — the gift rides straight through to checkout for free. This is the Shopify free gift exploit in a sentence, and the only reliable fix is to enforce the offer at checkout, server-side, not just in the cart UI.
What’s actually happening: browser vs checkout
There are two places an offer can be enforced, and they are not the same system.
- The storefront (browser). This is where the cart drawer, progress bars and “you unlocked a free gift!” messaging live. It’s JavaScript running on the shopper’s device. It’s great for merchandising — and it’s fully under the shopper’s control.
- Checkout. This is Shopify’s server. It’s the only place a price is actually committed. Anything not enforced here is a suggestion, not a rule.
A JavaScript-only gift app does all its work in the first place. It adds the gift and sets it to $0 in the browser, then hands the cart to checkout as-is. Checkout doesn’t re-ask “does this cart still deserve a free gift?” — it just charges what it was handed. So if the cart changed after the gift attached, checkout has no idea, and the free line item survives.
Why it matters: a direct margin leak
This isn’t a cosmetic bug. Every gamed gift is a physical product you ship at zero revenue, plus the pick-pack and shipping cost on top. Unlike a percentage discount that shaves a slice off a real sale, a leaked gift is pure cost against an order that no longer qualifies for it.
And it compounds at scale. One exploited gift is an annoyance. But the method is trivial to repeat, it spreads (screenshots of “add this, then delete it” travel fast), and a gift offer that’s live on every product page is exposed on every session. The bigger your traffic, the bigger the hole. You often don’t notice until you reconcile inventory and find gift SKUs walking out the door faster than the qualifying products that were supposed to earn them.
How the exploit works, step by step
It requires no tools and no technical skill:
- The shopper adds the qualifying product (or crosses the spend threshold).
- The gift app detects the qualifying cart and auto-adds the free gift at $0.
- The shopper removes the qualifying product from the cart.
- The JavaScript-only app doesn’t re-validate, so the $0 gift stays in the cart.
- Checkout charges what it was handed — and the gift ships for free.
The offer worked exactly as designed at step 2. The failure is that steps 3–5 were never checked by anything that can actually enforce a price.
How to check if your gift app is vulnerable
You don’t need to read anyone’s code. Run this 4-step manual test on your own store:
- Qualify. Add the qualifying product (or reach the spend threshold) so the offer triggers.
- Confirm the gift attaches. Verify the free gift appears in the cart at $0.
- Remove the qualifying item. Delete the product that unlocked the gift, leaving the gift behind.
- Go to checkout. Proceed to the checkout page and read the line items.
If the gift is still $0 at checkout after you removed the qualifying item, your offer is enforced in the browser only — and it’s exploitable. If the gift is removed or re-priced at checkout, you’re enforcing server-side. That’s the whole test.
The fix: enforce the gift with a Shopify Function
The durable fix is to move enforcement off the browser and onto Shopify’s server with a Shopify Function. A Function is code that runs inside the checkout pipeline, so it evaluates the cart at the moment of payment — after any last-second edits the shopper made.
A gift Function re-checks the cart server-side and answers three questions every time:
- Is the threshold still met (qualifying product present, or spend still above the line)?
- Is there exactly one eligible gift — not zero, not five?
- If the cart no longer qualifies, remove the gift or drop it back to its real price.
Because this runs at checkout, the “add it then delete the qualifier” trick has nothing to grab. The gift a shopper keeps is always one they’ve actually earned.
This is also why the enforcement layer matters more than the feature list. For the trade-offs between Function-based and JavaScript-only offers, see Shopify Functions vs discount apps.
What to look for in a gift app
When you evaluate a gift-with-purchase app, the merchandising is table stakes. The question that actually protects your margin is where the offer is enforced.
- Server-side enforcement. Look for the words “Shopify Function,” “checkout-safe,” or “enforced at checkout” — and then run the 4-step test above to confirm it’s real, not marketing.
- Re-validation on cart change. The offer should survive a shopper removing and re-adding items, not just a clean happy-path add.
- One gift, not many. The Function should cap the gift quantity so shoppers can’t stack duplicates.
- Graceful downgrade. When the cart stops qualifying, the shopper should see a clear result at checkout, not a silent free item.
Our own Profit Flow AOV Bundle is a free app whose free gift is enforced by a Shopify Function for exactly this reason — the gift is re-checked at checkout, so it can’t be gamed by removing the qualifying product.
Common mistakes
- Trusting the cart drawer. The cart UI showing the right price proves nothing. Only checkout commits a price. Always test through to checkout.
- Assuming “it works in testing” means safe. Happy-path testing (add qualifier → see gift → buy) passes on vulnerable apps too. You have to test the removal path.
- Blocking the gift in JavaScript instead of enforcing it. Hiding the remove button or disabling edits in the drawer is theater; a shopper can still edit the cart via the cart page or the AJAX API.
- Fixing it with fine print. A policy note that “the gift requires the qualifying item” doesn’t stop the order from processing for free. Enforcement has to be code, at checkout.
For setup walkthroughs once your enforcement is sound, see how to add a free gift with purchase on Shopify and how to let customers choose their free gift on Shopify. For structures, thresholds and checkout-safe examples, see our free gift with purchase solution.
Not sure if your free gift is checkout-safe? Try the 4-step test above. If it stays free after you remove the qualifying item, you’re leaking margin. See checkout-safe free gifts or get a free profit audit.