Skip to main content
Data Sources 101

Your guide to understanding and using Rebuy Data Sources

Christian Sokolowski avatar
Written by Christian Sokolowski
Updated over 3 months ago

What are Data Sources?

Data Sources (aka the rules engine) are the heart of the Rebuy Engine. The rules engine leverages AI and conditional rules (ie. IF this THEN that) rules to make it possible to tailor merchandising widgets across the entire customer journey from homepage to cart, checkout, post-purchase, and beyond.

Data Sources rules are made up of two sections, ‘IF’ and ‘THEN’, which is referred to as “RETURN” in Rebuy Data Sources. Each section can have multiple rules leveraging different objects to power personalization. For more information on the various objects in each section and how they can be used, read the Anatomy of Data Sources section of this document.


Breaking Down Conditional Rules

As mentioned above, conditional rules are made up of ‘Ifs’ and ‘Thens’. While both portions of the rule can have multiple objects, the ‘If’ portion of the rule combines the objects using “And” or “Or”. Below are two examples of how rules can look the same but be very different using “And” and “Or”.

Rule 1 only gets ice cream when it’s been a rough day and it’s Friday. If it’s a rough day but not Friday, no ice cream. If it’s a Friday, but not a rough day, no ice cream. However, Rule 2 gets ice cream if one of either of the options are true. Meaning you’re getting ice cream if it’s been a rough day or it’s a Friday. (🎉 seems like the real winner to me!)


Anatomy of Data Sources

Filters

Product filters will prevent a data source from returning certain products. Common filters can be applied using checkboxes.

  • Filter out of stock products: This will prevent the data source from returning products with 0 stock. Note: If you have enabled a product to continue selling when out of stock, checking this setting WILL NOT prevent that product from being returned.

  • Filter out of stock variants: This will prevent out of stock variants from displaying in the product's variant selector.

  • Filter input products: This will prevent the data source from returning input products. On cart widgets, products added to the cart are input products. On product page widgets, the featured product is the input product.

You can filter out specific products by clicking Add Exclusion Filter. Learn more about exclusion filters in this help document.

Data Source Rules

Within a Data Source there are four different parts that are combined to create the rule. Those four parts are:

  • Object: This will be Product, Cart, Customer, Input Product, etc.

  • Attribute: This will be Product Tag, Product Vendor, Product Handle, Cart Total, etc.

  • Operator: This will be Contains Any, Doesn’t Contain Any, Contains All, Equals, etc.

  • Value: This will be the words you input in the rule like “blue-shirt”. Ex: “If Product Tag contains “blue-shirt”.

The tables below are grouped by object, and outline the corresponding attribute, operator and values. The tables will look something like the following:

Attribute

Operator

Value

Below each table are keys—aka tips and tricks—for each object group. While we tried to cover as many use cases and as much additional helpful information as possible, this is not an exhaustive list.

With that in mind, let’s dive in!


IF Section

This section of the Data Source is where we set what conditions need to be met in order for the Return portion to be presented or shown.

Anything

This means that any customer, product, URL, etc. will trigger the Return portion of the rule. 🔑 Use this when you want the rule to render at all times.


Order Rules

Order Tags

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

Search Order Tags // select one or more order tags


Product Rules

Products

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

Search Products // select one or more products from your product catalog

Product Tags

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

Search tags // select one or more product tags

Product Title

Contains, Does Not Contain, Equals, Does Not Equal

Type the word/phrase you want included or excluded

Product Vendor

Contains, Does Not Contain, Equals, Does Not Equal

Type the word/phrase you want included or excluded

Product Type

Contains, Does Not Contain, Equals, Does Not Equal

Type the word/phrase you want included or excluded

Product Handle

Contains, Does Not Contain, Equals, Does Not Equal

Type the word/phrase you want included or excluded

🔑 Remember, when using ‘Equals’ or ‘Does Not Equal’ you need to type the exact word/phrase you want used. With ‘Contains’ or ‘Does Not Contain’, you can type keywords or partial phrases. ‘Equals’ requires an exact match where ‘Contains’ only looks for the words or phrases regardless of if there are other words around it.

Input

Input Products

Contains, Does Not Contain

Select Subscription Products or One-Time Products


Collection Rules

Collection

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

From a drop-down list, select one of your existing collections

Collection

Does Not Equal


Customer Rules

Customer

Customer Tags

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

Type the tags you want included/excluded; if using more than one, separate with a comma

Customer Order Count

Is Greater Than, Is Less Than, Is Equal To

Type the number you want used for the rule

Customer Total Spent

Is Greater Than, Is Less Than, Is Equal To

Type the total dollar amount you want used for the rule


Cart Rules

Cart

Contains, Does Not Contain

Search and select the products you want used for the rule

AND

Product Quantity

Less Than, Greater Than, Equals

Type the quantity of the specific product you want required for the Return to be shown

Cart Subtotal

Is Greater Than, Is Less Than, Is Equal To

Type the subtotal dollar amount you want used for the rule

Cart Line Count

Is Greater Than, Is Less Than, Is Equal To

Type the number of lines in the cart you want used for the rule

Cart Item Count

Is Greater Than, Is Less Than, Is Equal To

Type the number of items in the cart you want used for the rule

Cart Subtotal functions on it’s own and can not be combined with other rules for specific outcomes. For example, if a merchant is running a vendor specific promotion, say $10 off when you purchase $50 in Tarte products, you can not set that up using a combination of Cart Subtotal and Product Vendor.


Date Rules

Date

Is Before, Is After

Select a date and time using the calendar icon, or type a date and time following the format in the ghosted text

(Note: you can select only a date if you don’t want to select a time as well.)

Use two date rules—one with a ‘Before’ and one with an ‘After’ operator—to create a date range.


URL Rules

URL

Contains, Does Not Contain, Equals, Does Not Equal

When using ‘Equals’ or ‘Does Not Equal’ – Type the complete URL you want used for the rule

When using ‘Contains’ or ‘Does Not Contain’ – Type key words or phrases you want used for the rule

(Note: if using more than 1 URL or phrase, separate with a comma)

Leverage URL to tailor rules to specific audiences like customer email/SMS or paid ad traffic.


Geolocation Rules

Attribute

Operator

Value

Examples

Country Code

Contains, Does Not Contain, Equals, Does Not Equal

Type the country code you want used for the rule

US = United States

CA = Canada

Country Name

Contains, Does Not Contain, Equals, Does Not Equal

Type the country name you want used for the rule

United States

Canada

Province Code

Contains, Does Not Contain, Equals, Does Not Equal

Type the province code you want used for the rule

Alberta, CA = AB

California, US = CA

Province Name

Contains, Does Not Contain, Equals, Does Not Equal

Type the province name you want used for the rule

California

Alberta

Continent Code

Contains, Does Not Contain, Equals, Does Not Equal

Type the continent code you want used for the rule

NA = North America

AS = Asia

AF = Africa

Continent Name

Contains, Does Not Contain, Equals, Does Not Equal

Type the continent name you want used for the rule

North America

Asia

Africa

City Name

Contains, Does Not Contain, Equals, Does Not Equal

Type the city name you want used for the rule

New York

Paris

Tokyo

Postal Code

Greater Than, Less Than, Equal To

Type the postal code you want used for the rule

10001 = New York

SW1A 1AA = London

10115 = Berlin

Latitude

Greater Than, Less Than, Equal To

Type the latitude coordinate you want used for the rule

40.7128 = New York

51.5074 = London

48.8566 = Paris

Longitude

Greater Than, Less Than, Equal To

Type the longitude coordinate you want used for the rule

-74.0060 = New York

2.3522 = Paris

139.6917 = Tokyo

Please note that the accuracy of our geo-location provider is subject to certain limitations and can vary depending on various factors such as the quality of the IP address data, network infrastructure, and other technical factors. We do not guarantee the accuracy of these geo-based rules and recommend using them as a general guide rather than relying on them for precise geolocation purposes.


Klaviyo Segments

Attribute

Operator

Value

Examples

Klaviyo Segments

This will reflect the Klaviyo segments created in each merchant's instance, meaning the listed segment options will vary for each user

Contains User, Does Not Contain User

IF Klaviyo Segment Contains User "20k Customers"

RETURN "Top Sellers" Endpoint

Rebuy will pull Customer Segments from Klaviyo and then match emails from the Klaviyo profiles (associated to the segment) to Rebuy customer emails.

Merchants should continue to update and manage segments in Klaviyo to see updates in Rebuy Data Sources.

Read these help articles for more information on the available Klaviyo segments:


RETURN Section

This section of the Data Source is where we set what will be shown if the conditions of the If portion are met.

Product

No Products

Select this if you’d like the widget to Return no products.

Input Products

Select this to return the products that are being used on the If side of the rule.

Specific Products

Search for specific products and select the products you’d like returned for the rule

Products with Tags

Contains

Contains ALL Matched Input Tags

Contains ANY Matched Input Tags

Enter tags, separated with commas

Endpoint

Select the input you’d like used for this rule from the drop-down list

Default Endpoints:

  • Recommended (AI)

  • Top Sellers

  • Trending Products

  • Buy It Again

  • Recently Viewed

  • Similar Products (AI)

Collection

Select the collection you want used for this rule

Select “Sort By” option:

  • Don’t sort this output

  • Trending (24 hours)

  • Trending (90 days)

  • Similar Sort


Product Filters

Product Price

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

Type the dollar amount you want used for this rule. This rule must be used accompanied by a and "and" condition to return products.

Here are two different use cases for Product Price to get your wheels turning:

  1. Create a price range for products returned, for example, Product Price is greater than 75 AND Product Price is less than or equal to $200. This means the Data Source will select products that fall in the $75.01 and $200 price range.

  2. Product Price + Cart Subtotal + Cart Widget | IF Cart Subtotal is less than or equal to $50 RETURN Product Price less than or equal to $30.

When setting up a rule that involves the selection of "Product Price" as a return condition, it is essential to ensure that you include an "and" condition to return products. The available product return options include:

  • Input Products

  • Specific Products

  • Products with Tags

  • Products with Matching Metafields

  • Endpoints

  • Collection


Product Settings

Product Discount

Percentage, Fixed

Enter the percentage discount or dollar amount you want used for the rule

Product Quantity

Type the number of items you want added to the cart from the widget. (Ex: if you set the value to 3, then when the item is added to the cart from the widget it will add 3 x items)

Product Limit

Type the number of products you’d like the rule block to be limited to (Ex: if you set the value to 3, then the rule will only return 3 products.)

If you use Product Discount you must also make sure you have the discounting mechanism set up to ensure the discount is applied in the cart and at checkout. Rebuy does NOT perform the actual discounting for the widgets.


Widget Language

There are currently some Language options in the Data Source UI that are N/A for current Checkout Extension and Post Purchase widgets

Super Title

Type custom language for the widget’s Super Title here

Title

Type custom language for the widget’s Title here

Description

Type custom language for the widget’s Description here

Variant Option

Typing language in this field and the Variant Options field will override the settings in the widget editor.

Variant Options

Typing language in this field and the Variant Option field will override the settings in the widget editor.

Add to Cart

Type custom language for the widget’s ‘Add to Cart’ language here

Adding to Cart

Type custom language for the widget’s ‘Adding to Cart’ language here

Added to Cart

Type custom language for the widget’s ‘Added to Cart’ language here

Remove from Cart

Type custom language for the widget’s ‘Remove from Cart’ language here

Removing from Cart

Type custom language for the widget’s ‘Removing from Cart’ language here

Removed from Cart

Type custom language for the widget’s ‘Removed from Cart’ language here

Sold Out

Type custom language for the widget’s “Sold Out” language

Decline

Type custom language for the widget’s “Decline” button for an offer being presented

Thank You Title

Type custom language for the Thank You Page title

Thank You Description

Type custom language for the Thank You Page description

Thank You Button

Type custom language for the Thank You Page button

Use these Return options to create custom language on the widget in a variety of places. You can also use metadata to hyper-personalize language (e.g., Faves Picked For You, Molly!).

Metadata Objects You Can Use In Widget Data Sources

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

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

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

For more info, check out this help doc, or keep reading, there is more in-depth info below.


Widget Settings

Widget Discount

Percentage, Fixed

Enter the percentage discount or dollar amount you want used for the rule

If you use Product Discount you must also make sure you have the discounting mechanism set up to ensure the discount is applied in the cart and at checkout. Rebuy does NOT perform the actual discounting for the widgets.


Custom Data

Data (String)

Key - We explain these in detail below.

Value - We explain these in detail below.

Data (Number)

Key

Value

Data (JSON)

Key

Value

Did this answer your question?