Automatic Free Gifts on Shopify: How to Get Them to Auto-Add (and Auto-Remove!) from Your Cart

Ever wished your Shopify store could automatically add a free gift to a customer's cart once they hit a certain spend threshold, and then magically remove it if they drop below? It sounds like a simple request, right? Yet, as a recent community discussion highlighted, it's one of those features that isn't quite as straightforward with Shopify's native tools as you might hope.

Our fellow store owner, @minjunkim95, kicked off a great thread asking exactly this: "I'm looking at a free gift offer for orders over a certain amount. The discount part seems simple enough, but how does the gift get into the basket? I don't want customers hunting for it and adding it themselves. Also, if they remove something and go below the minimum, would the gift come back out? Has anyone found a setup that does both?"

This is a super common challenge, and the community really chimed in with some fantastic insights and solutions. Let's break down the two main paths discussed: custom code or leveraging the app ecosystem.

The Core Challenge: Shopify's Native Limitations

The first thing to understand, as Taha_Dev and Josh-FiveAcreCode eloquently explained, is that Shopify's built-in "Buy X Get Y" or amount-off discounts are excellent for making a gift free, but they do not automatically add the gift to the cart. Nor will they remove it if the cart subtotal drops. This is the crucial distinction that often trips up store owners.

So, if you want that seamless, automatic add-and-remove behavior, you'll need to look beyond the standard discount functionality.

Solution Path 1: The DIY Code Approach (Theme AJAX)

For those comfortable with a bit of code or who have developer support, Taha_Dev laid out a robust, app-free solution using your theme's cart AJAX functionality. This gives you a lot of control and can be a cost-effective option if you don't want to rely on a third-party app.

Step-by-Step for Theme AJAX Auto-Add/Remove:

  1. Create Your Gift Product: First, set up the free gift as a regular product or variant in Shopify. If you need to keep track of stock, make sure inventory tracking is enabled. Once it's set up, note down its unique variant ID – you'll need this for the code.
  2. Implement Cart Monitoring: In a Custom liquid section or a theme JS asset, you'll need to add some JavaScript that runs every time the cart changes. This includes updates to /cart.js, interactions with cart drawers, or quantity adjustments. Your script will compare the current cart subtotal (or line total, excluding the gift itself) against your set threshold.
  3. Auto-Add the Gift: If the cart subtotal is above your threshold and the gift product isn't already in the cart, your script will send a
    POST /cart/add.js
    request. This request will include the gift's variant ID, a quantity of 1, and crucially, a line property like
    properties[_free_gift]=true
    . This property acts as a flag, making it easy to identify the gift later.
  4. Auto-Remove the Gift: Conversely, if the cart subtotal drops below your threshold and the gift is present in the cart, your script will send a
    POST /cart/change.js
    request. This request needs the specific key of the gift's line item in the cart and a quantity: 0 to remove it.

Important Caveats with the Code Approach:

  • Race Conditions: Shoppers who click very fast can sometimes trigger race conditions. Taha_Dev suggests adding a debounce (around 300ms) to your script to mitigate this.
  • Cart Drawers: Ensure your script hooks into updates for both the full cart page and any cart drawers your theme uses.
  • Accelerated Checkout: Features like "Buy Now" buttons or accelerated checkout (Shop Pay, PayPal, etc.) can sometimes bypass your theme's JavaScript. Test these paths thoroughly!
  • Discount Pairing: Even with the auto-add/remove script, you still need to ensure the gift is free. Pair this setup with an automatic 100% discount specifically for that gift product (or simply make the gift product's price $0).

While this theme AJAX method is powerful, it does require a good understanding of JavaScript and Shopify's AJAX API.

Solution Path 2: The App Ecosystem to the Rescue

For many store owners, especially those without developer resources, the Shopify App Store offers a more accessible and often more robust solution. As Ellie-BOGOS highlighted, this is where third-party apps truly shine.

A Critical Insight from the Community: When looking at apps, Ellie-BOGOS wisely pointed out that many apps support auto-add, but not all support auto-remove. Make sure to check for both behaviors when testing!

Recommended Apps from the Discussion:

  • BOGOS: Free Gift Bundle Upsell
  • EG Auto Add to Cart Free Gift
  • Gift Box
  • Cart Marshal (mentioned by Josh-FiveAcreCode, who develops it)
  • Monk Free Gift with Purchase (detailed instructions below)

Detailed Instructions: Setting Up Auto-Add/Remove with an App (e.g., Monk Free Gift with Purchase)

Alaattincagil provided a clear, step-by-step guide using Monk Free Gift with Purchase, which is a great example of how these apps generally work:

  1. Prepare Your Gift Product: Just like with the code method, create your gift as a product in Shopify. Ensure it's active, in stock, and available on your Online Store sales channel.
  2. Create the Offer in the App: In the Monk app (or your chosen gift app), navigate to create a new offer. For Monk, this would be: Create Offer → Gifts, Shipping and Cart Goals → General Free Gifts → Auto Add. Here, you'll select your gift product, define the eligibility rule (e.g., "basket value is over $X"), and set the trigger to "Cart."
  3. Enable Auto-Remove and Refresh: Look for settings like "Cart Refresh and Behaviour." This is where you'll explicitly turn on Auto Remove. If your theme's cart drawer doesn't visibly update after changes, also enable Auto Refresh to ensure customers see the gift appear or disappear immediately.
  4. Save, Activate, and Test Thoroughly: Save your offer and activate it. Now, this is the most critical part: TEST, TEST, TEST!

How to Test Your Free Gift Offer:

  • Start with a basket value just below your threshold (gift should NOT appear).
  • Add an item to go just above the threshold (gift SHOULD appear automatically and show as free).
  • Remove an item to go back below the threshold (gift SHOULD be removed automatically).
  • Confirm the gift shows as free at checkout.

Alaattincagil also wisely suggested letting the app manage the gift's discount directly, rather than creating a separate Shopify "Buy X Get Y" discount. This keeps everything integrated and simplifies troubleshooting.

Josh-FiveAcreCode also chimed in about their app, Cart Marshal, which supports auto-adding gifts based on a minimum purchase amount or specific products in the cart. It also keeps the gift in sync, meaning it's automatically reduced or removed if the customer no longer qualifies. They even mentioned a free plan that includes the Gift with Purchase rule for one published rule, which is a great way to test it out. You'll just need to enable a theme extension for it to work.

Ellie-BOGOS also shared a helpful YouTube tutorial: How to Automatically Add Free Gift to Cart & Auto-Remove it Cart on Shopify | FAQs Included, which is a fantastic resource if you prefer visual learning.:blush:

Wrapping It Up: Your Choice, Your Store

So, @minjunkim95, and all you other store owners out there, you've got options! While Shopify's native discount system doesn't handle the automatic add/remove of free gifts, the community has clearly shown that it's a solvable problem. Whether you go the custom code route for ultimate control or tap into the power of the app ecosystem for an easier setup, the key is to choose the solution that best fits your technical comfort level and budget. Just remember to always test thoroughly to ensure that seamless customer experience!

It's a testament to the flexibility of the Shopify platform that even when a native feature isn't quite there, there are robust workarounds and apps to fill the gap, making your store truly shine. If you're thinking of starting your own online store, Shopify offers a fantastic foundation to build on, with a massive app ecosystem to extend its capabilities.

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases