Skip to main content

Data Sources 101

Complete reference for Rebuy Data Sources: every IF rule, RETURN option, operator, value type, combination, and limitation.

Written by Tom

What are Data Sources in Rebuy?

Data Sources are the rules engine that powers every Rebuy widget. They use conditional IF / RETURN logic combined with AI endpoints to control which products a widget surfaces across the customer journey, from homepage to cart, checkout, post-purchase, and beyond.

A Data Source rule is built from two halves:

  1. An IF section defining the conditions that must be true for the rule to fire.

  2. A RETURN section defining what products, settings, or language the rule outputs when the IF conditions are met.


How Data Source Rules Evaluate

Understanding rule evaluation is critical for setting up Data Sources that behave as expected. Three behaviors govern how Rebuy processes a Data Source.

Rules Are Evaluated Top to Bottom

Rebuy evaluates Data Source rules sequentially from top to bottom. The order of your rules directly impacts which products get returned. Position your most specific or highest-priority rules at the top of the list. Broad catch-all rules, such as IF Anything, should always sit at the bottom because they fire only when no rule above them matches.

Rule Evaluation Is Cumulative by Default

Evaluation is cumulative, not first-match-wins. If a widget is configured to display 10 products and the first matching rule only returns 5, Rebuy keeps evaluating rules below it to fill the remaining 5 slots. To stop this, enable Exit If Matched on the rule.

Exit If Matched Setting

The Exit If Matched toggle stops the Data Source from evaluating further rules once that rule's IF conditions are met. This is useful when you want a specific rule to override broader rules listed further down, or when you want to prevent widget refill behavior after a customer adds a product. Setting path: Data Source > Rule > Exit If Matched.

AND vs OR Logic Inside a Rule

When the IF section of a single rule contains multiple conditions, you can combine them with AND or OR.

  • AND: all conditions must be true simultaneously for the rule to fire.

  • OR: any one condition being true is enough to fire the rule.


Anatomy of a Data Source Rule

Every Data Source rule is built from four parts.

  • Object: the entity being evaluated, such as Product, Cart, Customer, Input Product, URL, or Date.

  • Attribute: the specific property of that object, such as Product Tag, Cart Subtotal, or Customer Order Count.

  • Operator: the comparison, such as Contains Any, Does Not Contain Any, Equals, Is Greater Than.

  • Value: the actual content matched against, such as blue-shirt, 100, or a selected product.

A complete rule reads as: IF [Object] [Attribute] [Operator] [Value], THEN RETURN [Return Type].

Example logic block:

IF  Product Tag Contains Any → "winter-collection"
RETURN Collection → "Outerwear"


Data Source Filters

Filters apply before any rule is evaluated. They control which products are excluded from the widget's output globally for this Data Source.

Filter Out of Stock Products

Prevents the Data Source from returning products with zero stock. If a product is configured in Shopify to continue selling when out of stock, this filter will not prevent it from being returned.

Filter Out of Stock Variants

Prevents out of stock variants from displaying in the product's variant selector inside the widget.

Filter Input Products

Prevents the Data Source from returning input products. On cart widgets, the input products are the items already in the cart. On product page widgets, the input product is the featured product on the page. For Post Purchase widgets, the input products are the items in the customer's recent order.

Add Exclusion Filter

Click Add Exclusion Filter inside the Data Source to exclude specific products from this Data Source only. For a global exclusion across every Rebuy widget on the store, assign the Shopify product tag exclude_rebuy to the product. Learn more in the Exclusion Filters article.


Quick Reference: All IF Rules and Their Operators

Every IF rule type available in Rebuy Data Sources, with the operators each rule supports. Full details for each rule are in the sections below.

Object

Attribute

Supported Operators

Anything

(none)

Always true

Product

Input Product

Contains, Does Not Contain (value is subscription or one-time)

Product

Products

Equals Anything, Contains Any, Does Not Contain Any, Contains All, Does Not Contain All, Equals, Does Not Equal

Product

Product Tags

Equals Anything, Contains Any, Does Not Contain Any, Contains All, Does Not Contain All, Equals, Does Not Equal, Regular Expression

Product

Product Title

Contains, Does Not Contain, Equals, Does Not Equal

Product

Product Vendor

Contains, Does Not Contain, Equals, Does Not Equal

Product

Product Type

Contains, Does Not Contain, Equals, Does Not Equal

Product

Product Handle

Contains, Does Not Contain, Equals, Does Not Equal

Product

Product Has Metafield

Equals

Product

Collection

Equals Anything, Contains Any, Does Not Contain Any, Contains All, Does Not Contain All, Equals, Does Not Equal

Inventory

Any Cart Item's Inventory

Is Less Than, Is Greater Than, Is Equal To, Is Not Equal To

Inventory

Each Cart Item's Inventory

Is Less Than, Is Greater Than, Is Equal To, Is Not Equal To

Customer

Customer (logged in)

Fires when a Shopify customer ID is present

Customer

Customer Tag

Equals Anything, Contains Any, Does Not Contain Any, Contains All, Does Not Contain All, Equals, Does Not Equal

Customer

Customer Order Count

Is Greater Than, Is Less Than, Is Equal To

Customer

Customer Total Spent

Is Greater Than, Is Less Than, Is Equal To

Cart

Cart

Contains All, Contains Subscription, Does Not Contain Any

Cart

Cart Subtotal

Is Greater Than, Is Less Than, Is Equal To

Cart

Cart Line Item Count

Is Greater Than, Is Less Than, Is Equal To

Cart

Cart Total Item Count

Is Greater Than, Is Less Than, Is Equal To

Geolocation

Country Code

Contains, Does Not Contain, Equals, Does Not Equal

Geolocation

Country Name

Contains, Does Not Contain, Equals, Does Not Equal

Geolocation

Province Code

Contains, Does Not Contain, Equals, Does Not Equal

Geolocation

Province Name

Contains, Does Not Contain, Equals, Does Not Equal

Geolocation

Continent Code

Contains, Does Not Contain, Equals, Does Not Equal

Geolocation

Continent Name

Contains, Does Not Contain, Equals, Does Not Equal

Geolocation

City Name

Contains, Does Not Contain, Equals, Does Not Equal

Geolocation

Postal Code

Is Greater Than, Is Less Than, Is Equal To

Geolocation

Latitude

Is Greater Than, Is Less Than, Is Equal To

Geolocation

Longitude

Is Greater Than, Is Less Than, Is Equal To

Klaviyo

Klaviyo Segment

Contains User, Does Not Contain User

Date

Date

Is Before, Is After, Equals

URL

URL

Contains, Does Not Contain, Equals, Does Not Equal

Order

Order Tags

No operators. Select one or more order tags synced from Shopify.


IF Conditions: Setting Up Your Data Source Rules

Detailed reference for every IF rule type. Each section includes what the rule does, the supported operators, the value type, and a sample logic block.

IF Anything Rule

The IF Anything rule is always true. Use it at the bottom of a Data Source as a catch-all that fires when no rule above matches. Always pair it with Exit If Matched disabled so it fills remaining slots after more specific rules above.

IF  Anything
RETURN Endpoint → Recommended (AI)

IF Input Product Rule

Targets or excludes input products by whether they are a subscription product or a one-time product. The input product is the featured product on a product page, or the products in the cart for cart widgets.

Operators: Contains, Does Not Contain.

Value: subscription or one-time.

IF  Input Product Does Not Contain → "subscription"
RETURN Specific Product → [Free Gift Product]

IF Products Rule

Targets or excludes specific products selected from the Shopify catalog. Selection happens at the product or variant level.

Operators: Equals Anything, Contains Any, Does Not Contain Any, Contains All, Does Not Contain All, Equals, Does Not Equal.

Value: one or more products selected from a searchable product picker.

The difference between Equals and Contains matters in carts with multiple products: Equals requires the cart to contain only the specified products, while Contains Any fires if any of the specified products are present, regardless of what else is in the cart.

IF Product Tags Rule

Targets or excludes products based on the Shopify product tags assigned to them.

Operators: Equals Anything, Contains Any, Does Not Contain Any, Contains All, Does Not Contain All, Equals, Does Not Equal, Regular Expression.

Value: one or more product tags.

IF  Product Tag Contains Any → "summer-collection"
RETURN Collection → "Summer 2025"

IF Product Title Rule

Targets or excludes products by their title text.

Operators: Contains, Does Not Contain, Equals, Does Not Equal.

Value: a word or phrase to match against the product title.

With Equals or Does Not Equal, the rule requires an exact title match. With Contains or Does Not Contain, the rule matches partial phrases anywhere inside the title.

IF Product Vendor Rule

Targets or excludes products by their Shopify vendor.

Operators: Contains, Does Not Contain, Equals, Does Not Equal.

Value: a vendor name.

IF Product Type Rule

Targets or excludes products by their Shopify product type.

Operators: Contains, Does Not Contain, Equals, Does Not Equal.

Value: a product type.

IF Product Handle Rule

Targets or excludes products by their Shopify product handle (the URL slug).

Operators: Contains, Does Not Contain, Equals, Does Not Equal.

Value: a product handle.

IF Product Has Metafield Rule

Fires when the input product has a populated metafield matching the namespace.key entered. Most commonly paired with the Products with Matching Metafields RETURN option to recommend products that share a metafield value with the input product, such as recommending products with the same custom.color_name.

Operators: Equals.

Value: the metafield namespace and key in the format namespace.key, for example custom.color_name.

IF  Product Has Metafield Equals → "custom.color_name"
RETURN Products with Matching Metafields → "custom.color_name"

Full setup steps are in the Metafield Data Source Rules article.

IF Collection Rule

Targets or excludes products based on the Shopify collections they belong to.

Operators: Equals Anything, Contains Any, Does Not Contain Any, Contains All, Does Not Contain All, Equals, Does Not Equal.

Value: one or more collections selected from a dropdown.

IF Any Cart Item's Inventory Rule

Fires when at least one item in the customer's cart has a Shopify inventory level that meets the operator condition. Use this rule to surface restock-friendly recommendations, low-stock urgency offers, or fallback products when any cart item is running low.

Operators: Is Less Than, Is Greater Than, Is Equal To, Is Not Equal To.

Value: a number representing Shopify inventory level for the cart item.

IF  Any Cart Item's Inventory Is Less Than → 10
RETURN Specific Product → [Restock Soon Product]

Inventory rules evaluate the Shopify inventory level of cart items, not the quantity of items in the cart. To trigger rules based on cart quantity, use Cart Total Item Count or Cart Line Item Count.

IF Each Cart Item's Inventory Rule

Fires when every item in the customer's cart has a Shopify inventory level that meets the operator condition. Stricter than Any Cart Item's Inventory because all cart items must satisfy the threshold.

Operators: Is Less Than, Is Greater Than, Is Equal To, Is Not Equal To.

Value: a number representing Shopify inventory level for the cart item.

IF  Each Cart Item's Inventory Is Greater Than → 50
RETURN Endpoint → Top Sellers

Inventory Rules compatibility: Inventory rules are NOT compatible with Product Page widgets. They work with Cart widgets, Post Purchase widgets, and Checkout Extensions widgets only. Learn more about Inventory rules.

IF Customer (Logged-In) Rule

Fires when a Shopify customer ID is present, in other words, when the customer is logged in. Use this to scope rules to logged-in customers only.

Operators: none. The rule fires whenever a customer ID is present.

Value: none.

IF Customer Tag Rule

Targets or excludes customers based on the Shopify customer tags assigned to them.

Operators: Equals Anything, Contains Any, Does Not Contain Any, Contains All, Does Not Contain All, Equals, Does Not Equal.

Value: one or more comma-separated customer tags.

IF Customer Order Count Rule

Targets customers based on how many Shopify orders they have placed.

Operators: Is Greater Than, Is Less Than, Is Equal To.

Value: a number.

IF Customer Total Spent Rule

Targets customers based on their lifetime spend in Shopify.

Operators: Is Greater Than, Is Less Than, Is Equal To.

Value: a dollar amount.

IF Cart Rule

Targets the rule based on what is currently in the customer's cart.

Operators: Contains All, Contains Subscription, Does Not Contain Any.

Value: one or more products selected from the catalog. Contains Subscription fires whenever any cart line item has a subscription selling plan attached.

IF Cart Subtotal Rule

Targets the rule based on the cart subtotal.

Operators: Is Greater Than, Is Less Than, Is Equal To.

Value: a dollar amount.

IF Cart Line Item Count Rule

Targets the rule based on the number of distinct line items in the cart. Two different variants of the same product count as two line items.

Operators: Is Greater Than, Is Less Than, Is Equal To.

Value: a number.

Add Condition: Scope Cart Line Item Count by Tag or Collection

Click Add Condition on the Cart Line Item Count rule to scope the count to a subset of cart items. Two scoping options are available.

  • With Tag: counts only cart line items whose product has the specified Shopify product tag.

  • From Collection: counts only cart line items whose product belongs to the specified Shopify collection.

IF  Cart Line Item Count Is Greater Than → 2  With Tag → "apparel"
RETURN Specific Product → [Free Gift Product]

IF Cart Total Item Count Rule

Targets the rule based on the total quantity of items in the cart. Three of the same product count as three items.

Operators: Is Greater Than, Is Less Than, Is Equal To.

Value: a number.

Add Condition: Scope Cart Total Item Count by Tag or Collection

Click Add Condition on the Cart Total Item Count rule to scope the count to a subset of cart items. Two scoping options are available.

  • With Tag: counts only cart items whose product has the specified Shopify product tag.

  • From Collection: counts only cart items whose product belongs to the specified Shopify collection.

IF  Cart Total Item Count Is Greater Than → 3  From Collection → "Shirts"
RETURN Collection → "Pants" → Sort By: Smart Sort

IF Geolocation Rules

Targets the rule based on the customer's approximate location. Geolocation is derived from the visitor's IP address.

Attribute

Operators

Value Examples

Country Code

Contains, Does Not Contain, Equals, Does Not Equal

US, CA

Country Name

Contains, Does Not Contain, Equals, Does Not Equal

United States, Canada

Province Code

Contains, Does Not Contain, Equals, Does Not Equal

CA (California), AB (Alberta)

Province Name

Contains, Does Not Contain, Equals, Does Not Equal

California, Alberta

Continent Code

Contains, Does Not Contain, Equals, Does Not Equal

NA, EU, AS

Continent Name

Contains, Does Not Contain, Equals, Does Not Equal

North America, Europe, Asia

City Name

Contains, Does Not Contain, Equals, Does Not Equal

New York, Paris, Tokyo

Postal Code

Is Greater Than, Is Less Than, Is Equal To

10001 (New York)

Latitude

Is Greater Than, Is Less Than, Is Equal To

Latitude coordinate value

Longitude

Is Greater Than, Is Less Than, Is Equal To

Longitude coordinate value

Geolocation accuracy depends on IP data quality and varies based on network infrastructure. Treat geolocation rules as general targeting, not precise filtering. Learn more about Geolocation rules.

IF Klaviyo Segment Rule

Targets customers based on Klaviyo customer segments. Rebuy matches the customer's email from Klaviyo segment profiles to the Shopify customer record.

Operators: Contains User, Does Not Contain User.

Value: a Klaviyo segment selected from the dropdown. Available segments are pulled from your connected Klaviyo account.

IF  Klaviyo Segment Contains User → "VIP Customers"
RETURN Endpoint → Top Sellers

Segments must be managed and updated inside Klaviyo. Changes sync to Rebuy automatically. Learn more about Klaviyo segments in Data Sources.

IF Date Rule

Controls when the Data Source rule is active based on the store's timezone. To create a date range, combine two Date rules in the same rule block with AND logic: one with Is After and one with Is Before.

Operators: Is Before, Is After, Equals.

Value: a date and optional time selected from the calendar picker.

IF URL Rule

Targets the rule to specific page URLs or traffic sources, including UTM parameters.

Operators: Contains, Does Not Contain, Equals, Does Not Equal.

Value: a URL or a partial URL string. For multiple values, separate with commas. With Equals or Does Not Equal, the full URL must match. With Contains or Does Not Contain, the rule matches partial strings such as UTM parameter values.

IF Order Tags Rule

Targets customers based on the Shopify tags applied to their previous orders. The Order Tags rule does not use operators. Instead, the tag picker is populated with values synced directly from Shopify, and the rule fires when the customer's previous orders match any of the selected tags.

Operators: none.

Value: one or more order tags selected from the synced Shopify tag picker.

IF  Order Tags → "vip-customer"
RETURN Specific Product → [VIP Product 1, VIP Product 2]


Quick Reference: All RETURN Options

Every RETURN option available in Rebuy Data Sources, organized by the six Object categories: Products, Product Settings, Product Filters, Widget Language, Widget Setting, and Custom Data. Full details for each option are in the sections below.

RETURN Object

Attribute

Output

Products

Input Products

Returns the same products used in the IF section.

Products

No Products

Returns nothing. Used to suppress the widget for specific IF conditions.

Products

Specific Product

Hand-selected products from a searchable product picker.

Products

Products with Tags

Operators: Contains, Contains ALL Matched Input Tags, Contains ANY Matched Input Tags. Each operator supports two Sort By options: Smart Sort, Don't sort this output.

Products

Products with Matching Metafields

Returns products that share the input product's metafield value for the specified namespace.key.

Products

Endpoint

Endpoints: Recommended (AI), Similar Products (AI), Top Sellers, Trending Products, Buy It Again, Recently Viewed, Custom Endpoint.

Products

Collection

Sort By: Don't Sort, Smart Sort, Similar Sort.

Products

Products In Metafield

Returns products assigned to the input product via a Shopify list.product_reference metafield.

Product Settings

Product Discount

Type Options: Percentage, Fixed.

Product Settings

Product Quantity

(numeric value, no type options)

Product Settings

Product Limit

(numeric value, no type options)

Product Filters

Product Price

Operators: Less Than, Less Than or Equal To, Equal To, Greater Than, Greater Than or Equal To. Must be combined with a Products RETURN option using AND logic.

Widget Language

Super Title

Text Value

Widget Language

Title

Text Value

Widget Language

Description

Text Value

Widget Language

Variant Option

Text Value

Widget Language

Variant Options

Text Value

Widget Language

Add to Cart

Text Value

Widget Language

Adding to Cart

Text Value

Widget Language

Added to Cart

Text Value

Widget Language

Remove from Cart

Text Value

Widget Language

Removing from Cart

Text Value

Widget Language

Removed from Cart

Text Value

Widget Language

Sold Out

Text Value

Widget Language

Decline

Text Value

Widget Language

Thank You Title

Text Value

Widget Language

Thank You Description

Text Value

Widget Language

Thank You Button

Text Value

Widget Setting

Widget Discount

Type Options: Percentage, Fixed.

Custom Data

Data (String)

Key plus string value.

Custom Data

Data (Number)

Key plus number value.

Custom Data

Data (JSON)

Key plus JSON value.


RETURN Products

The Products RETURN object outputs products to the widget. Eight sub-options are available, each defining a different source for the products returned.

Products

Attribute

What It Returns

Input Products

IF section input

The same products used in the IF section.

No Products

(none)

Nothing. Used to suppress the widget for specific IF conditions.

Specific Product

Searchable product picker

Hand-selected products chosen from the Shopify catalog.

Products with Tags

Shopify product tags

Products that have matching Shopify tags. Operators: Contains, Contains ALL Matched Input Tags, Contains ANY Matched Input Tags.

Sort By options: Don't Sort, Smart Sort

Products with Matching Metafields

Shopify metafield value

Products that share the input product's metafield value for the specified namespace.key.

Endpoint

Rebuy AI or behavioral endpoint

Products from available endpoints: Recommended (AI), Similar Products (AI), Top Sellers, Trending Products, Buy It Again, Recently Viewed, Custom Endpoint.

Collection

Shopify collection

Products from a selected Shopify collection.

Sort By options: Don't Sort, Smart Sort, Similar Sort

Products In Metafield

list.product_reference metafield

The specific products assigned to the input product via a Shopify metafield reference.

RETURN Input Products

Outputs the same products used in the IF section. Common in widgets where the input product itself should be re-surfaced, such as a Cross-Sell that recommends adding more of the same item.

RETURN No Products

Outputs nothing for this rule. Useful when paired with a specific IF condition that should suppress the widget entirely, such as IF Cart Contains Subscription → RETURN No Products.

RETURN Specific Product

Outputs hand-selected products from a searchable product picker. Used when the merchant wants explicit, manual control over which products the widget recommends.

RETURN Products with Tags

Outputs products that have the specified Shopify product tags assigned. Three operators are supported.

  • Contains: returns products that contain the tags entered in the rule.

  • Contains ALL Matched Input Tags: returns products that share every tag with the IF input product.

  • Contains ANY Matched Input Tags: returns products that share at least one tag with the IF input product.

Sort By Options for Products with Tags

Each of the three operators above supports two Sort By options that control the order of the returned products.

  • Smart Sort: AI reorders the returned products to surface the best converting products first.

  • Don't sort this output: returns products without applying any reordering.

RETURN Products with Matching Metafields

Outputs products that share the same metafield value as the input product for the specified namespace.key.

For example: with the rule set to custom.color_name, if the input product has custom.color_name = "Red", Rebuy returns every product in the catalog where custom.color_name also equals "Red".

This RETURN option is typically paired with the IF Product Has Metafield condition to ensure the rule only fires when the input product has the relevant metafield populated.

RETURN Endpoint

Outputs products from a Rebuy AI or behavioral endpoint selected from the dropdown. See Data Source "Endpoints" - General Overview for more details.

  • Recommended (AI): AI-driven personalized recommendations based on the input product and customer behavior.

  • Similar Products (AI): AI-driven similarity recommendations based on the input product.

  • Top Sellers: products with the highest sales volume over the past 1 to 90 days. Defaults to 90 days. Does not factor in product price, only sales count.

  • Trending Products: products with rising recent purchase momentum.

  • Buy It Again: products the customer has previously purchased.

  • Recently Viewed: products the customer has recently viewed.

  • Custom Endpoint: points this rule at another Data Source. Used to chain Data Sources together when a single Data Source needs more than 50 rules. Learn more about Custom Endpoints.

RETURN Collection

Outputs products from a selected Shopify collection. Sort options control the order in which products are returned.

  • Don't Sort: returns the collection in its default Shopify order.

  • Smart Sort: AI reorders the collection to surface the best converting products first.

  • Similar Sort: AI reorders the collection to surface products most similar to the input product first.

RETURN Products In Metafield

Outputs the specific products that have been manually assigned to the input product via a Shopify list.product_reference metafield. This gives merchants editorial control over per-product recommendations, such as a Complete the Look widget that recommends curated accessories.

Products In Metafield Requirements:

  • The metafield type must be List > Product (list.product_reference) in Shopify.

  • Storefront API access must be enabled on the metafield definition in Shopify.

  • Each input product must have the metafield populated with selected products. If the metafield is empty on the input product, the widget will return nothing.

  • Variant-level metafields are not supported. Metafield rules operate at the product level only.

Full setup steps for both metafield RETURN types are in the Metafield Data Source Rules article.


RETURN Product Settings

Product Settings apply per-rule controls to how returned products behave or display in the widget, including discount labels, add-to-cart quantity, and product limits. Three settings are available.

Product Setting

Available Type Options

What It Controls

Product Discount

Percentage, Fixed

Visual discount label on returned products.

Product Quantity

(numeric value, no type options)

How many units are added per add-to-cart click.

Product Limit

(numeric value, no type options)

Maximum number of products returned by this rule.

Return Product Discount

Applies a visual discount label to products returned by this rule.

Type Options: Percentage, Fixed.

Value: a percentage (for Percentage) or a dollar amount (for Fixed).

Important: The Product Discount return rule is visual only. It does not adjust the price in the cart or at checkout. To apply an actual discount, create a Shopify Automatic Discount or enable a Shopify Functions discount through the Widget Editor's Discount tab. Learn more about Rebuy discounting.

Return Product Quantity

Controls how many units are added to the cart when the customer adds the widget product.

Value: a number. Setting this to 3 means each click adds 3 units of the product.

Return Product Limit

Caps how many products this rule block returns. Setting this to 3 means the rule will return at most 3 products, even if more match the IF conditions.


RETURN Product Filters

Product Filters restrict the products returned by the rule's RETURN Products output. Filters are not standalone RETURN options, they must be combined with a Products RETURN option using AND logic.

Filter

Operators

What It Restricts

Product Price

Less Than, Less Than or Equal To, Equal To, Greater Than, Greater Than or Equal To

Restricts returned products to a specific price range. Must be combined with a Products RETURN option using AND logic.

Product Price Filter

Restricts the price range of products that will be returned. The Product Price filter is not a standalone RETURN option, it must be combined with another RETURN type using AND logic.

Operators: Less Than, Less Than or Equal To, Equal To, Greater Than, Greater Than or Equal To.

Value: a dollar amount.

Product Price must be paired with one of: Input Products, Specific Product, Products with Tags, Products with Matching Metafields, Products In Metafield, Endpoint, or Collection.

IF  Cart Subtotal Is Less Than → $50
RETURN Endpoint → Recommended (AI)
AND Product Price Less Than Or Equal To → $30


RETURN Widget Language

Widget language settings override the default text on the widget for this specific rule, including titles, button labels, and state messages. Useful for tailoring widget copy to specific audiences or product types.

Some Language options in the Data Source editor are not applicable to Checkout Extensions widgets or Post Purchase widgets.

Available Language Override Fields

Sixteen language fields can be overridden, in UI order.

Field

Output

Super Title

Text Value

Title

Text Value

Description

Text Value

Variant Option

Text Value

Variant Options

Text Value

Add to Cart

Text Value

Adding to Cart

Text Value

Added to Cart

Text Value

Remove from Cart

Text Value

Removing from Cart

Text Value

Removed from Cart

Text Value

Sold Out

Text Value

Decline

Text Value

Thank You Title

Text Value

Thank You Description

Text Value

Thank You Button

Text Value

Metadata Variables for Dynamic Language

Insert dynamic values into widget language using metadata variables. For example, {{ metadata.shopify_customer.first_name }} renders as the customer's first name. A title like Faves Picked For You, {{ metadata.shopify_customer.first_name }}! displays as Faves Picked For You, Molly! for a customer named Molly.

Available metadata variables:

  • Product Title: {{ metadata.input_products[0].title }}

  • Customer First Name: {{ metadata.shopify_customer.first_name }}

  • Vendor: {{ metadata.input_products[0].vendor }}


RETURN Widget Setting

Widget Setting options apply visual overrides to the widget output for this specific rule.

Setting

Type Options

What It Controls

Widget Discount

Percentage, Fixed

Visual discount label across all products returned by this rule.

Return Widget Discount

Applies a visual discount label across all products returned by this rule. Supports Percentage or Fixed dollar amounts.

Important: The Return Widget Discount rule is visual only. It does not adjust prices in the cart or at checkout. To apply an actual discount, use the Widget's Editor Discount tab to enable a Shopify Functions discount. Learn more about Rebuy discounting.


RETURN Custom Data

Custom Data passes additional key-value pairs to the widget for advanced personalization or developer-driven customization.

Data Type

Format

What It Accepts

Data (String)

Key + string value

Plain text values passed to the widget.

Data (Number)

Key + number value

Numeric values passed to the widget.

Data (JSON)

Key + JSON value

Structured JSON objects passed to the widget.

For full setup steps, see Custom Data Sources and Metadata.


Data Source Limitations and Invalid Combinations

Known limitations and rule combinations that are not supported.

Cart Subtotal Cannot Be Combined for Vendor- or Product-Specific Spend

Cart Subtotal cannot be combined with other rule types to create vendor-specific or product-specific spend conditions. For example, "$10 off when you spend $50 on Tarte products" is not supported, because Cart Subtotal evaluates the entire cart total, not the subtotal of a vendor or product subset. Cart Subtotal must be used as a standalone IF condition.

Line Item Properties and Cart Attributes Are Not Supported

Data Source rules cannot evaluate Shopify line item properties or cart attributes. This applies even for A/B testing tools that pass tracking data through these fields.

Variant-Level Metafields Are Not Supported

Metafield Data Source rules operate at the product level only. Variant-level metafield values cannot be used as IF conditions or RETURN values.

Dynamic Bundle Widget IF Rules Cannot Be Variant-Specific

The Dynamic Bundle Widget cannot use variant-specific IF rules for the input product. The rule must use IF Products Contains Any with the product selected at the product level (all variants). RETURN items can still be variant-specific.

Rule Count Limit

Rebuy recommends keeping Data Source rules to 30 or fewer per Data Source. The hard maximum is 50. Exceeding the recommended limit can cause slow widget load times and failed Data Source saves. To scale beyond 50 rules, use Custom Endpoints to chain multiple Data Sources together, switch from individual product rules to tag or collection rules, or use multiple widgets each with their own Data Source.

Data Sources Cannot Be Exported Between Shopify Stores

Data Sources are tied to product IDs within the current Shopify store. They cannot be exported to or imported from another store.


Frequently Asked Questions About Data Sources

Can I duplicate a Data Source?

Yes. On the Data Sources page, click the three dots next to the Data Source you want to duplicate and select Duplicate Ruleset.

What happens if a widget's Data Source rules aren't met?

If no rule's IF conditions are met, the widget displays nothing. The widget remains installed on the page, but no products are surfaced until the conditions are satisfied.

What should I do when I need more than 50 rules?

Three approaches scale Data Sources beyond 50 rules:

  • Tag or Collection rules: Replace individual product rules with tag-based or collection-based rules. Broader coverage with far fewer rules. See the Collection Rules article and Tag Rules article.

  • Custom Endpoint: Split rules across multiple Data Sources (each with about 25 rules), then chain them together using RETURN > Endpoint > Custom Endpoint. Learn more about Custom Endpoints.

  • Multiple widgets: Duplicate the widget and assign each copy its own Data Source, keeping each one under the rule limit.

How can I avoid conflicting rules?

Check for overlapping IF criteria, such as including and excluding the same product or tag in the same Data Source. Position the most specific rules at the top and catch-all rules at the bottom. Rebuy evaluates rules top to bottom, so a catch-all near the top will override the specific rules below it.

How do I test if my Data Source is working correctly?

Use the Preview tool inside the Data Source editor to verify the expected products are returned for each rule. Then simulate the rule conditions on the storefront: add the relevant products to a test cart, visit the relevant page, or check the widget while logged in as a tagged customer.

What are best practices for naming Data Sources?

Use descriptive names that reflect the Data Source's purpose and the widget context. For example, "Product Page Cross-sell by Tag - Apparel" is clearer than "Data Source 12". Clear names make it easier to identify the right Data Source when building or editing widgets.

Which widgets automatically add products to the cart?

Only the Gift With Purchase Widget and the Tiered Progress Bar automatically add a product to the cart when their IF conditions are met. All other Rebuy widget types display product recommendations for the customer to select and add manually.

Did this answer your question?