A Gift With Purchase (GWP) offer automatically adds a free or discounted gift to a customer's cart when their cart meets conditions you define — for example, spending over a threshold or buying specific products. GWP offers build brand loyalty, help you move targeted inventory (buy X, get Y), and raise average order value by encouraging customers to spend more to unlock the gift.
This article walks through creating a Gift With Purchase widget end to end: creating the widget, defining the qualifying rules, discounting the gift, installing it, configuring every setting, and how gifts are validated at checkout.
What the Gift With Purchase Widget Does
The Gift With Purchase widget is a headless widget: it has no visual interface for the customer. It works silently in the background, automatically adding the gift to the cart the moment the cart matches your Data Source rules. There is no button, popup, or product card for the shopper to interact with.
Because it is headless, this widget is the right choice when you want the gift added automatically with no customer action. If you instead want a visible gift promotion — a progress meter toward a reward, or a "choose your gift" experience — use one of these instead:
Tiered Progress Bar — shows a visual bar tracking progress toward a free-gift threshold. See Tiered Progress Bar and the Smart Cart.
Selectable Gift With Purchase — lets customers choose their gift from several options. See Selectable Gift-With-Purchase Widgets.
Other methods — for a full comparison of every way to run a GWP promotion with Rebuy, see Ways to Create a Gift-With-Purchase Offer with Rebuy.
Plan availability: Creating a GWP widget and discounting the gift with Shopify Functions is available on all Shopify plans. Only the automatic gift removal at checkout (see GWP Validation at Checkout) requires Shopify Plus.
Subscription note: A GWP widget can use one-time products as the gift. Subscription products cannot be returned as the gift, though a subscription product can be used as the qualifying (trigger) item in your rules.
Step 1: Create the Gift With Purchase Widget
To create the widget, in Rebuy Admin go to Merchandising Widgets, create a new widget, and select the Gift With Purchase type. This opens the widget editor, where the remaining steps are configured.
(Image above: Rebuy Admin — creating a new Gift With Purchase widget)
Step 2: Configure the Data Source (Qualifying Rules)
The Data Source defines the cart conditions a customer must meet to receive the gift, and which product is returned as the gift. In the widget editor, find Data Source and click the Edit link to open the connected Data Source Rule Builder or click Create new data source to build a new one.
(Image above: Gift with Purchase widget editor — Edit Data Source)
A Data Source rule follows an IF / RETURN pattern. For example:
IF Cart Subtotal is GREATER THAN a dollar amount, RETURN the free gift product.
IF Cart Subtotal is GREATER THAN a dollar amount AND/OR Products Contains Any of a set, RETURN the free gift product.
Follow these guidelines when building GWP conditions to avoid the most common problems:
Use "Products Contains Any," not "Product Equals." "Contains Any" adds the gift whether the qualifying product is the only cart item or part of a larger cart, and it prevents the gift from flashing or looping in the cart.
Include Cart Subtotal in every OR block. With OR statements, each block must carry all applicable conditions. Use "Cart Subtotal ≥ $50 OR Cart Subtotal ≥ $100" rather than "Country = US OR Cart Subtotal ≥ $50," which creates an ambiguous configuration.
Schedule the promotion in the Data Source. Set the rule's active time period so the offer starts and ends automatically without manual toggling.
Gifts with multiple variants — return a single variant. If your gift product has multiple variants, configure the Data Source to RETURN one specific variant only. If the Data Source returns the product with all of its variants selected, the Gift With Purchase widget adds every selected variant of that product to the customer's cart — not just one. Because the gift is added automatically with no variant chooser, the customer cannot pick which variant they receive, so the Data Source must specify the exact variant to give.
(Image above: Data Source Rule Builder — IF Cart Subtotal Is Greater Than X RETURN free product)
Step 3: Discount the Gift
Discounting is what makes the gift free (or reduced). Rebuy applies the discount using Shopify Functions, configured on the widget editor's Discount tab. Without a discount, the widget will add the product to the cart but the customer will be charged full price for it.
To make the gift free, configure the discount as follows:
Click open the Discount tab from the widget's editor.
Turn on Discounted By Functions. This applies a real discount in the cart and at checkout. If it is left off, the discount is visual only — shown in the widget but not applied — and the customer is charged.
Set the Discount Type to Percentage (enter 100 for a fully free gift) or Fixed (enter an amount equal to the product's price).
Optionally set a Discount Message shown in the cart, and a Quantity cap limiting how many units of a single line get the discount.
(Image above: Gift with Purchase widget editor's Discount tab — Use Discounted By Functions toggle with discount Percentage set to 100%)
Visual-only discounts: If you want the widget to display a discount without applying it at the cart, leave Discounted By Functions toggled OFF. The customer will be charged the full price.
Discount combination limitation: Shopify does not allow two product discounts on the same product. If another product discount is competing for the gift item, the gift can end up undiscounted even though Rebuy's widget attribution is present on the order. Check both Rebuy Order Discount and Rebuy Product Discount settings in your Shopify admin when troubleshooting. For how Rebuy discounts stack, see Rebuy Discounting Overview.
Storefront API recommendation: For accurate, real-time discounting — and to ensure products are removed from the cart when they no longer qualify — enable the Storefront API. Without it, gifts that no longer qualify may not be removed after a discount is applied. See Smart Cart Discount Codes.
Step 4: Install the Gift With Purchase widget (GWP) to your Shopify Online Store
Installation makes the widget live on your storefront. In the widget editor, click the Install link in the top-right of the editor header. A new window opens with instructions specific to your theme — follow them carefully, as they may include copying and pasting code or configuring theme settings.
The Gift With Purchase widget is a global widget (it is not tied to a single page). If you install it manually, copy the HTML Div Placement snippet from the widget editor's Advanced screen into your theme where the widget should initialize.
For definitions of "installed," "uninstalled," and "live mode," see Rebuy Widget Installation Definitions.
(Image above: Rebuy Admin "Gift with Purchase" widget editor showing a two step annotated setup: step 1 highlights the "Live Mode" toggle turned off with the instruction "Toggle OFF Live Mode, Click Save", and step 2 highlights the "INSTALL" button with the instruction "Install to Shopify Online Store")
(Image above: Widget editor Install button and theme editor install flow)
Managing Live Mode
Live Mode controls whether the installed widget is active for customers. Live Mode is ON by default when you create a widget. Before you finish installing — if you want to test the widget without customers seeing it — toggle Live Mode OFF first. Turn it on when you are ready for the offer to go live.
Previewing Your Offer Before Going Live
Preview mode lets you test a Gift With Purchase offer on your live storefront without any customers being able to trigger it. This is the recommended way to confirm the offer works before turning it on. Because the widget is headless, previewing means confirming the gift auto-adds and is correctly discounted — there is no visual widget to inspect.
The widget must be installed in your Shopify theme first. Preview mode only works once the Gift With Purchase widget has been installed in your Shopify theme (see Step 4: Install the Gift With Purchase widget (GWP) to your Shopify Online Store). Preview mode activates an installed-but-not-live widget for your browser session — it does not inject a widget that is not installed. If the widget is not installed, nothing will happen in preview.
When Live Mode is OFF, the widget is installed but does not fire for regular visitors. To test it yourself, open your storefront in preview mode using either method:
Click PREVIEW in the top-right of the widget editor.
Or add
?preview=trueto the end of your store URL (for example,https://yourstore.myshopify.com?preview=true).
Either method sets a preview cookie in your browser only, so the widget activates for your session while staying hidden from customers. A Rebuy banner appears on the storefront confirming you are in preview mode.
While in preview, confirm the full offer end to end:
Add items that meet your Data Source rules and confirm the gift is automatically added to the cart.
Confirm the gift's price reaches $0 (or the intended discounted amount). This verifies the Shopify Functions discount is actually applied and not visual-only.
Remove the qualifying items and confirm the gift is automatically removed.
To exit preview mode, add ?preview=disable to your store URL (or use the toggle in the Rebuy preview banner). Once the offer behaves correctly, turn Live Mode ON to make it live for all customers.
For more details on using Rebuy Preview Mode see Using Rebuy preview mode.
Ending a Discount Promotion Cleanly
When your promotion ends, disabling the widget is not enough to stop the discount. To prevent discounts from being cached on carts, set the Shopify Functions Discount to None in the widget's settings once the promotion has ended.
This is necessary because Rebuy's Shopify Functions discounts are attribution-based: if a product line item still carries the Rebuy widget attribution data, the configured discount continues to apply even after the widget is disabled.
(Image above: Rebuy Admin "Gift with Purchase" widget editor, "Discount" tab, highlighting "Discount Type" set to "None".)
Warning: Even if the widget is disabled and set to Preview Mode, the associated discount remains active until you set the discount to None as described above.
Shopify cart cookie: Shopify's cart cookie keeps items in a customer's browser for up to 14 days. If a customer added a gift before you disabled the widget, that gift stays in their cart until they remove it, clear their browser cache, or the cookie expires. Disabling the widget prevents new gifts from being added but does not remove gifts already in active carts.
Best Practices
Follow these practices to keep GWP offers performing reliably:
Preview the offer before going live: keep Live Mode off, open your storefront with
?preview=true, and confirm the gift auto-adds and reaches $0 before turning Live Mode on. See Previewing Your Offer Before Going Live.Use Smart Cart latest version with Shopify Functions for the best GWP experience.
Use Date Scheduling in the Data Source so promotions start and end automatically.
Regularly review and update your Data Source rules as your promotions change.
Always confirm discount combination settings in Shopify when combining discounts.
Test discounted promotions thoroughly before making them active.
When troubleshooting discount issues, check both Rebuy Order Discount and Rebuy Product Discount settings in your Shopify admin.
Widget Settings Reference
Beyond the Data Source and discount, the widget editor exposes several settings that control gift behavior and display. The settings below are the ones that apply to the Gift With Purchase widget; other widget screens (Language, Tiers, Subscriptions, Layout) are hidden for this widget type because they do not apply.
Gift Options
The Gift Options settings, on the Widget settings screen, control how the gift behaves in the cart. Each option does the following:
Allow Customer to Remove Gift — lets the shopper remove the free gift from their cart. When this is on and a customer manually removes the gift, Rebuy remembers that choice with a cookie and will not automatically re-add the gift even if the customer re-qualifies. Turn this off to keep the gift locked in the cart as long as the customer qualifies. When on, you can also edit the removal confirmation dialog text (Remove Title, Remove Description, Confirm Button, Cancel Button) and enable Removal Without Confirmation to skip the dialog entirely.
Allow Gifts Without Purchase — controls whether a gift can sit in an otherwise empty cart. See the behavior note below.
Hide Quantity Selectors in Cart — hides the quantity controls on gift line items. This requires the Rebuy Smart Cart and does not affect native theme carts.
(Image above: Rebuy Admin "Gift with Purchase" widget editor, "Widget Settings" panel, showing the "GIFT OPTIONS" section highlighted with "Allow Customer to Remove Gift", "Allow Gifts Without Purchase" and "Hide Quantity Selectors in Cart")
Allow Gifts Without Purchase — default behavior: On newly created GWP widgets, gifts are not added to an empty cart, and a gift is automatically removed if it becomes the only item in the cart. On older, pre-existing widgets, gifts are allowed in an empty cart. Enable this setting to allow gifts in an empty cart; disable it to have a lone gift automatically removed.
Exclude Items
The Exclude Items settings, on the Widget settings screen, remove certain item types from the cart calculations that trigger the gift. Enable Gift Cards or Digital Items to exclude those item types from the cart total, line count, and item count used to evaluate your Data Source rules.
(Image above: Rebuy Admin "Gift with Purchase" widget editor, "Widget Settings" panel, showing the "Exclude Items" section highlighted with "Gift Cards" and "Digital Items" checkboxes)
Variant Selector
Not applicable to the Gift With Purchase widget. A Variant Selector setting appears on the Widget settings screen, but it has no effect for the Gift With Purchase widget. Because this widget automatically adds the gift to the cart, the customer never sees a variant selector — there is no opportunity to choose a variant once the gift is already in the cart. If you need customers to choose a variant of the gift, build a Selectable Gift With Purchase widget instead. See Selectable Gift-With-Purchase Widgets.
Product Settings
On the Product settings screen, the only setting that applies to the Gift With Purchase widget is Product Redirect. Set Learn More to Product to let the gift product link to its product page, or to Disabled to remove that link.
The rest of the Product settings tab does not apply to the Gift With Purchase widget. Because this widget has no user interface — it only auto-adds or removes the gift according to the Data Source ruleset — the Product Options, Product Quantity Controls, and Product Images groups on this tab have no effect. The widget editor shows this reminder on the Product settings screen: "Gift with Purchase type widgets do not have any user interface." Leave these groups at their defaults.
(Image above: Rebuy Admin "Gift with Purchase" widget editor, "Product Settings" tab, with the "GENERAL" section expanded showing "PRODUCT REDIRECT" set to "Learn More" > "Product" or "Disabled".)
Advanced: Attribution and Tracking
The Advanced screen holds tracking toggles and developer options. Enable Attribution Tracking and Enable Product Discovery Tracking add hidden product properties used for performance and engagement metrics — leave these on, or you will lose those metrics. The Advanced screen also holds the manual-install HTML div snippet and per-event JavaScript callbacks for developers.
Styling note: Because the Gift With Purchase widget is headless, the Styles screen's color and button controls have little practical effect. If you need to style how the gift appears inside another surface (such as the Smart Cart), use the Custom CSS field on the Styles screen.
(Image above: Rebuy Admin "Gift with Purchase" widget editor, "Advanced" panel, showing collapsed "DYNAMIC PLACEMENT" and "CALLBACKS" sections and an expanded "PRODUCT PROPERTIES" section with "Enable Attribution Tracking" and "Enable Product Discovery Tracking" both checked)
GWP Validation at Checkout
Rebuy's Gift With Purchase (GWP) validation logic runs during the Shopify checkout process to keep free gifts honest. A background process called the GWP watcher monitors the cart at checkout, re-evaluates your GWP widget's Data Source rules, and automatically removes any gift that no longer qualifies. This prevents a customer from adding qualifying items to unlock a gift, then removing those items before paying while keeping the gift for free.
Shopify Plus only: GWP validation at checkout requires Shopify Plus. It relies on checkout extensions, which are available only on Shopify Plus plans.
How GWP Validation Works at Checkout
When a customer reaches checkout, the GWP watcher re-checks whether the cart still meets the Data Source rules for each active GWP widget, then decides whether to keep or remove the gift:
The gift stays when the Data Source is still valid and the gift line still carries at least one discount allocation.
The gift is removed when the Data Source is no longer valid (for example, the cart subtotal dropped below the qualifying threshold), or when the gift line has no discount allocation at all — such as when a non-combinable discount code strips every discount off the line.
Removing a gift whose free status was overridden protects the customer from being charged full price for an item they expected to receive for free. Because Shopify does not let customers remove items during checkout, this automatic removal is the only way to prevent that unexpected charge.
Note: Auto-removal happens only at the checkout step itself. If a customer navigates back to the cart, the gift may still appear there. This GWP watcher logic is specific to the Gift With Purchase widget (and to checkout offer widgets with Treat as Gift With Purchase enabled) — it does not run against gifts added through the Tiered Progress Bar, which validates and removes its own gifts through separate logic in the progress bar itself.
Requirements and Limitations
For GWP validation to run at checkout, and to run correctly, the following requirements and limitations apply:
Shopify Plus is required. The GWP watcher runs on checkout extensions, which are exclusive to Shopify Plus.
At least one checkout widget must be active on the checkout page — a checkout recommendation widget, a checkout progress bar, or a checkout content block. Without an active checkout widget, the watcher does not run regardless of any other setting.
The gift must carry GWP widget attribution. This comes from a standard GWP widget, or from a checkout offer widget with Treat as Gift With Purchase enabled (a Checkout Extensions setting — see the next section).
The Data Source must return specific products. An AI-recommended endpoint does not return a fixed product, so the watcher treats it as invalid and removes the gift.
URL rules and order tag rules are not supported. These rule types are not accessible inside Shopify checkout extensions. When a Data Source uses them, validation is skipped rather than evaluated incorrectly, so the gift is not auto-removed.
Shopify Markets with fixed pricing can misfire. When products use fixed market prices, the watcher can incorrectly remove gifts for customers shopping in a non-default currency. See the edge case below.
A partial discount is not detected. The watcher only checks whether the gift line has any discount allocation at all — it does not check whether that discount fully zeroes out the price, and it does not check whether the discount actually came from Rebuy. If the intended 100%-off discount is misconfigured, or is replaced by a different discount that still leaves some (but not all) of the price discounted, the gift line still has a discount allocation and is not auto-removed — the customer can end up paying a partial price for what should be a free gift. Verify in a test checkout that gift lines actually reach $0 rather than assuming the watcher will catch a partially-discounted gift.
Edge Case: Shopify Markets + Fixed Pricing
When your store uses Shopify Markets with fixed market prices (rather than dynamic currency conversion), the GWP watcher may incorrectly remove gifts at checkout for customers shopping in a non-default currency. This happens because Shopify does not expose currency conversion rates at checkout, so the watcher's threshold calculation uses the wrong value.
❌ Problem Scenario (Different Currency + Fixed Pricing)
Setup: Shop default currency USD, GWP threshold $10 USD, customer switches to GBP, Shopify currency rate ~0.755 (converted threshold: £7.55)
Product A: USD price $8, GBP price £8 ⚠️ (fixed market pricing — not dynamically converted)
In Cart: GWP calculation uses
8 × (1 / 0.755) = $10.59→ threshold met → 🎁 GWP is addedAt Checkout: Watcher references checkout subtotal (fixed £8) → subtotal appears below threshold → GWP watcher removes the gift ❌
Workaround: If your store uses Shopify Markets with fixed pricing across multiple currencies, test your GWP threshold behavior in each currency where you have fixed prices. Consider setting thresholds that account for this discrepancy, or use dynamic (non-fixed) pricing where GWP promotions are active.
Frequently Asked Questions
Do I need to be on a Shopify Plus plan to use the GWP widget?
A Shopify Plus plan is not required to use the Gift With Purchase widget. You can discount the gift with Shopify Functions directly in the widget's settings on any Shopify plan, and on any plan the widget adds and removes the gift in the cart based on your Data Source rules. Shopify Plus is only required for the GWP validation logic that automatically removes an unqualified gift at the checkout step. Without Shopify Plus, the widget still adds and removes the gift in the cart, but it does not re-check the cart at the checkout step. This matters most when a discount that is not combinable with the gift's discount is applied at checkout: Shopify — not Rebuy — controls discount combination, so the gift's discount can still be stripped there. Without the checkout watcher, though, the gift item itself is not removed, so the customer keeps the gift in their cart and is charged full price for it. Removing the item in that situation is exactly what the Shopify Plus validation logic does. See the GWP Validation at Checkout section for details.
What should I do if the GWP item repeatedly flashes in and out of the cart after being added?
If the repeated "Flashing" you are describing means the gift is added to the cart and then immediately removed again, over and over, so the gift line item flickers or the cart keeps refreshing. This usually happens when the Data Source rule uses "Product Equals" instead of "Products Contains Any." With "Product Equals," adding the gift changes the cart contents and breaks the exact match, so the widget removes the gift — which makes the cart match the rule again and re-adds it, creating a loop. Update the Data Source rule to use "Products Contains Any" to stop the loop.
Why isn't the GWP being added to the cart?
If your Gift With Purchase widget isn't adding the gift product to the cart, go through these checks:
Confirm the widget is installed and live. Make sure the Gift With Purchase widget is installed in your Shopify theme and that Live Mode is on. If it is not installed on the Shopify side, it cannot add the gift. See Step 4: Install the Gift With Purchase widget (GWP) to your Shopify Online Store.
Confirm the gift product's status allows it. The gift product must be set to Active or Unlisted in Shopify. Draft and Archived products are blocked from all Rebuy Data Source responses (and Draft products also cause an error at Shopify checkout). If the gift is Unlisted, it must still be published to the Online Store sales channel and be returned through a Specific Product return in the Data Source, because Unlisted products are filtered out of AI, collection, tag, and algorithmic endpoints. See Using Unlisted Products for Gift With Purchase Offers.
Confirm the cart meets your rules. Check that the cart actually satisfies your Data Source rules, such as reaching the qualifying subtotal.
Gift not discounted to free — why is my free gift being added to the cart but still charging the customer?
If the gift is added to the cart but not discounted to $0 and the customer is still charged for it, the gift's discount is not being applied. This is usually one of two things:
The Shopify Functions discount is not enabled. On the widget's Discount screen, turn on Discounted By Functions so the discount is actually applied rather than shown visually only. Also confirm the Rebuy Product Discount automatic discount is set to Active in your Shopify Admin under Discounts.
Another discount is overriding Rebuy's discount. Because of Shopify's discount combination rules, only one product-level discount can apply to a given product at a time. If another Shopify discount — or a third-party discount app that manages discounts through its own Discount API — targets the gift product, it can strip or block Rebuy's Functions discount, so the gift is charged. Set your active Shopify discounts to combine with each other, avoid overlapping another product discount with the gift, and audit any installed discount apps that run their own discounts so only one tool owns the gift's discount.
Why is the free gift not automatically re-added after a customer removes it?
When Allow Customer to Remove Gift is enabled and a customer manually removes the gift, Rebuy records that removal with a cookie and will not add the gift back — even if the customer later re-qualifies. Rebuy does this to respect the customer's choice to decline the gift. To keep the gift in the cart whenever the customer qualifies, disable Allow Customer to Remove Gift. If you would rather let customers add the gift back themselves, use a Selectable Gift With Purchase widget instead. See Selectable Gift-With-Purchase Widgets.
Why is my GWP widget still providing the free gift after I disabled the widget?
This question is about gifts or discounts that persist after you turn the widget off. Disabling a GWP widget stops it from adding the gift to any new carts, but two things can make it look like the offer is still running:
Existing carts keep the gift item. Shopify's cart cookie holds items in a customer's browser for up to 14 days. A customer who added the gift before you disabled the widget keeps it until they check out, remove it, or clear their cache. This is why you may still see new orders containing the gift after disabling — they are from shoppers who already had it, not from new customers.
The discount keeps applying until you set it to None. Rebuy's Shopify Functions discount is attribution-based: as long as a gift line item still carries the widget's attribution, the configured discount continues to apply — even after the widget is disabled or set to Preview Mode. To fully stop the discount, open the widget's Discount screen and set the Shopify Functions Discount to None. See Ending a Discount Promotion Cleanly.
Is it possible to automatically add a free product to cart after a customer has entered a discount code?
A discount code can trigger a Gift With Purchase (GWP) in Rebuy by pairing a GWP widget with the IF Discount Code Rule. Set the IF rule to Discount Code, choose Equals or Contains, enter the code, and set the RETURN to a Specific Product. When the shopper applies the code in the Smart Cart discount field, the rule fires and the gift is added to the cart. The code must be valid in Shopify independently of the gift, so it cannot be a Buy X Get Y code scoped to the gift product, because that code will not validate until the gift is already in the cart. The rule reads only manually entered codes, and it is not supported on Post Purchase Offer widgets. For the full rule reference, see Discount Codes as a Condition Input for Data Sources.
Why are products not being removed from the cart after discounts are applied?
This applies while a GWP promotion is still active and live — when a customer's cart changes so a discounted product (such as a free gift) no longer qualifies, but the product is not removed from the cart in real time. This is typically caused by not using the Storefront API: the older, deprecated discounting method does not re-validate the cart and remove products when they stop qualifying. Enable the Storefront API for real-time discount validation and automatic cart adjustment. This is a different situation from gifts that linger after you have disabled the widget (see "Why is my GWP widget still providing the free gift after I disabled it?") and from the Shopify Plus checkout removal covered in the GWP Validation at Checkout section.
Can I use both the Tiered Progress Bar and Gift with Purchase widget together?
Using both tools to add a gift for the same promotion is technically possible but can cause conflicts such as duplicate gifts being added to a cart. If you want the Gift With Purchase widget to add the gift while the Tiered Progress Bar shows visual progress toward it, use a decorative tier on the progress bar rather than a functional gift tier. A decorative tier displays the reward milestone without adding its own gift, so the Gift With Purchase widget stays the only thing adding the gift and no duplicates occur. See Using the Decorative Tier in Rebuy's Tiered Progress Bar. Otherwise, choose the one tool that best fits your promotion and disable the other for that promotion.
How do I set up a Selectable GWP widget?
A Selectable Gift With Purchase widget is not a standard Rebuy widget type — it is a customized Cart Cross-Sell widget, and it requires additional custom code to work correctly. See Selectable Gift-With-Purchase Widgets.
Are subscription products supported as the gift?
Subscription products are not supported as the GWP gift. Only one-time purchase variants can be returned as the gift, although a subscription product can be used as the qualifying (input) product.
Can a GWP widget automatically add a free gift when a subscription is in the cart?
You can automatically add a free gift when a subscription is in the cart by pairing the Gift With Purchase (GWP) widget with a Cart Contains Subscription data source rule. Set the rule's IF condition to Cart, then Contains Subscription, and set RETURN to Specific Product and choose your gift. The GWP widget then adds that gift whenever the cart contains a subscription.
How do I trigger a gift only for a specific subscription product instead of any subscription?
To trigger the gift only for a specific subscription product:
Set a IF Cart rule, with the Contains All operator, and select the specific product.
Click the AND button next to the product, then select Contains Subscription.
Set RETURN to Specific Product and choose your gift.
If you add more than one product to a Contains All condition, the rule becomes more restrictive, because every product you list must be in the cart at the same time for the rule to match. Add products to Contains All only when you intend to require all of them together.
(Screenshot above of the Rebuy admin Data Source rule editor, IF Cart and the operator dropdown is set to Contains All, with the specific subscription product selected.)
Why does my Gift With Purchase (GWP) widget keep adding and removing from the cart a when I attempt a Buy One Get One (BOGO) gift setup?
A Gift With Purchase widget loops — adding and removing the gift repeatedly — when the gift is the same product as the qualifying product and the Data Source rule uses the Equals operator. Equals compares your rule's products against the cart's products position by position, so it depends on the order items sit in the cart. When the widget adds the gift, that ordering shifts, the rule stops matching, and the widget removes the gift. Removing it restores the original order, the rule matches again, and the gift is re-added. That add-and-remove cycle is the loop.
How to resolve it depends on the offer:
Simple BOGO — add the gift once when the product is in the cart. Open your Gift With Purchase widget → Data Source, and change the IF rule from Products → Equals to Products → Contains Any. Contains Any checks only whether the product is present in the cart, ignoring both position and quantity, so it stays satisfied after the gift is added and the gift is never removed and re-added. This configuration — Products Contains X → Return X — is supported for a fixed, non-scaled Buy X Get X offer.
Count-based BOGO — gift tied to a number of items. Because the gift counts toward the cart once added, use two rules so the count including the gift does not flip the condition. To give gift X once the cart has more than two qualifying items:
Rule 1 — IF Cart Total Item Count Is Equal To 3 AND Cart Contains All X, RETURN No Products.Rule 2 — IF Cart Total Item Count Is Greater Than 2, RETURN Specific Product X.
Rule 2 adds the gift at three qualifying items. Rule 1 removes it if the customer later drops back below that threshold, which prevents them from deleting a qualifying item and keeping the gift. Data Source count rules have no "greater than or equal to" operator — only Is Greater Than, Is Less Than, and Is Equal To — which is why Rule 2 uses Is Greater Than 2 rather than a value of 3.
True 1:1 same-product scaling — buy 2 of X, get 2 of X, and so on. The Gift With Purchase widget does not support matched-quantity scaling when the gift and the qualifying product are the same, because the widget re-adds the identical product whenever an instance is removed, so quantities cannot be adjusted as intended. Switching to a different gift product does not fully solve this either: quantity rules with a cap limit support a fixed offer such as Buy 2X Get 2Y, but not unlimited scaling. For a genuinely matched-quantity offer, build the experience with Smart Flows Buy X Get Y, which supports flexible qualifiers and built-in Shopify Functions discounting.
My GWP uses a URL Contains rule, but the gift disappears when I navigate to another page. How do I keep it in the cart?
If a gift added by a URL Contains rule disappears on navigation, use an Advanced UTM rule instead. Set up a specific UTM parameter for the campaign — for example a URL Contains rule keyed on utm_source=, utm_medium=, utm_campaign=, or utm_content= — so the gift persists as the customer navigates. See URL/UTM Based Rules.
Essentially, you will need to ensure there is a specific UTM that can be keyed off of for your particular GWP campaign. For example, if you use a URL Contains rule that starts with utm_source= , utm_medium= , utm_campaign=, utm_content= it should work as expected, and the GWP won't disappear when the customer navigates away to a different page on the site.
Will the GWP validation logic run during checkout?
Rebuy's GWP validation logic can run during the Shopify checkout process to monitor cart conditions and automatically remove gifts if a customer no longer qualifies. This feature is available on Shopify Plus only and requires at least one active checkout widget on the checkout page. For full details, see the GWP Validation at Checkout section above.
Can I use a checkout offer widget as a Gift With Purchase widget?
Checkout offer (recommendation) widgets include a Treat as Gift With Purchase setting in their Advanced Settings tab. When enabled, the GWP watcher validates that widget's items exactly as it would a standard GWP widget — removing the gift if cart conditions are no longer met. This requires both Enable Attribution Tracking and Enable Widget Tracking to be on — without Widget Tracking, the watcher cannot identify the item and will not validate or remove it — and is available to Shopify Plus merchants. For full setup steps, see Checkout Extensions Installation and Settings.
Does Rebuy automatically remove GWP products at checkout when a discount code overrides their free status?
Rebuy automatically removes a GWP product at checkout when a discount code, an automatic discount, or any other discount that isn't combinable with the gift's discount causes that GWP item to lose its free status — but only when the GWP watcher's own requirements are met. This runs through the same GWP watcher logic described in the GWP Validation at Checkout section, and it has the same requirements: Shopify Plus and at least one active checkout widget.
If those requirements are not met, the GWP watcher does not run, so the gift item itself is not automatically removed — but its discount is still lost, since discount combinability is controlled by your store's discount configuration rather than by the GWP watcher. In that case, the customer keeps the gift item in their cart, but they are charged full price for it.













