Articles on: Recommendation rules

How to Set up Custom Recommendations Rules

Plans: All Plans Platforms: Shopify


Overview


AfterShip Personalization enables you to set up custom recommendation rules for your checkout and post-purchase page. In simple terms, you can configure rules and conditions based on which the product recommendations will be shown to the customer during the pre and post-purchase scenarios to keep the shopping experience clean, targeted, and precise.


What you’ll learn


In this article, we will show you:



Steps to setup custom recommendations rules


  1. Log in to your AfterShip Personalization account.
  2. Navigate to Merchandising engine > Strategies page.
  3. Edit the existing strategy to set up custom rules for cross-sell widgets and smart offers or create a new strategy.
  4. To Edit an existing recommendation strategy, click Edit.
  5. Scroll down to Recommendation rules > Custom rules > Add rule.
  6. Set up Rules encompassing the Conditions and Actions that will decide what products will show in your offers.
  7. Add fallback rule that will help generate more products based on the recommendation strategy and filters you set up in case the existing rules do not generate enough product recommendations.
  8. Save the changes.
  9. Set the rules in order of priority with a simple drag-and-drop.


Important things to remember when setting up custom rules


  • There is no limit to the number of rules you can create
  • You can set the priority of the rules with a simple drag-and-drop
  • Each rule requires conditions and product attributes to trigger an action
  • You can set up custom conditions that will trigger an action
  • You can choose what action will be triggered when the conditions are matched
  • The selected action (product recommendations) will only be displayed when all the predefined conditions are met
  • By checking Exit if matched all the rules configured afterward will be ignored if the current rule is matched



How does the “Exit if matched” function work?


CASE I: If the ACTION configured for RULE I is ITEM 1 and must contain Product tags women and “Exit if matched” is enabled, our system will only show ITEM I as a product recommendation on the order checkout page if the condition is matched. RULE 2 and its respective CONDITIONS and subsequent ACTION will be ignored.



CASE II: If the ACTION configured for RULE I is ITEM 1 and must contain Product tags women and “Exit if matched” is enabled. If the condition does not match for RULE I, RULE II will be checked if its conditions are matching the existing checkout scenario. If the condition does not match for RULE II, and  â€œExit if matched” is enabled, RULE III, if applicable, will be checked and the corresponding action will be triggered if matched.


CASE III: If the ACTION configured for RULE I is ITEM 1, ITEM 2, ITEM 3 and must contain Product tags women, and for RULE 2, the product recommendation type is Best sellers and must contain Product tags women. Say the conditions of both the cases are the same and “Exit if matched” is not enabled for either of the rules. Based on the priority of the rules, in this case, the manually selected items for RULE I and Best sellers both will appear if RULE I is matched. RULE II will automatically match since the conditions were the same for both. First the product recommendations of RULE I will appear and then your store's Best sellers (RULE II) will appear. So the products that will be displayed on the order checkout page would be (ITEM 1, ITEM 2, ITEM 3) and (Best sellers). The items of each rule can appear in any order among themselves.




CASE IV: If the ACTION configured for RULE I is ITEM 1 and RULE 2 it’s ITEM 4, ITEM 5, ITEM 6. Say the conditions of both the cases are different and  â€œExit if matched” is not enabled for either of the rules. If the condition(s) of RULE I does not match, RULE II will be checked and the corresponding action will be triggered if matched. If matched, the products displayed on the order checkout page would be ITEM 4, ITEM 5, ITEM 6.




Conditions


What are the conditions you can configure to customize recommendations?


CONDITIONS are triggers based on which a certain action will set off. You can set up Cart, Product, Geolocation, and UTM conditions based on which selected action will be taken



1. Cart conditions


Type

Logic

Meaning

Cart value

>, <, =, ≄, ≀

The total sum of all products purchased during an order process

Number of products in cart

>, <, =, ≄, ≀

The total number of products in the shopper’s existing cart

Products in cart

Contain any of, Do not contain

Specific products in the shopper’s existing cart


2. Product conditions


Type

Logic

Meaning

Product types

Contain any of, Do not contain

Recommend products based on the product types as defined in your Shopify store

Product tags

Contain any of, Do not contain

Recommend products based on the product tags as defined in your Shopify store. You can also reach out our support team to unlock popular AI-generated product tags for free.

Product vendors

Contain any of, Do not contain

Recommend products based on the product vendors as defined in your Shopify store

Product collections

Contain any of, Do not contain

Recommend products based on the product collections as configured in your Shopify store

Product on product detail page

Contain any of, Do not contain

Specific products that the shopper is currently viewing on the PDP. For example, If a customer is viewing a snowboard (say, "The Multi-managed Snowboard"), you could use the "Product on product detail page" condition to trigger recommendations (Opt for Frequently bought together as Action) for products that are related to snowboarding, such as: Snowboarding boots, Bindings, or Protective gear like wrist guards or helmets.

Product created date

Is on, Is before, Is on or before, Is after, Is on or after, In the last

Recommend products based on the specific date when the item was first added to the store in the Shopify's admin

Product stock

Is less than, Is less than equal to, Is greater than, Is greater than equal to, Is equal to

Recommend products based on the current available inventory of a specific item in the Shopify's admin




3. UTM conditions


The UTM conditions allow you to set up custom product recommendation rules based on specific parameters in a URL and suggest products accordingly. The UTM parameters are tags added to the URLs to track the progress, effectiveness and source of tracking of the marketing campaigns like email and SMS.


UTM conditions work only with Attentive integration. The UTM parameters in the URLs of the Attentive email campaigns and the same ones used to defined UTM specific custom rules in the smart upsell widget will help AfterShip Personalization decipher from where the customer has landed on the URL given in the email and what type of product recommendations needs to be shown to them. Without the Attentive integration, the UTM conditions will not work.


Example: For example, show Best sellers on the checkout page when the utm_source is attentive or when the utm_campaign is welcome_email.


Type

Logic

Meaning

utm_source

Is any of, Is none of

Identifies the source of the traffic. In this case Attentive.

utm_medium

Is any of, Is none of

Identifies the medium or channel used, such as email and SMS.

utm_campaign

Is any of, Is none of

Tracks the name of the email or SMS campaign.

utm_content

Is any of, Is none of

Identifies what someone clicked on to get to your site when there are multiple links pointing to the same URL in the email.

utm_term

Is any of, Is none of

Track paid keywords you're targeting with your email campaign.

utm_id

Is any of, Is none of

Tracks a unique identifier that can be appended to URLs in Attentive to track campaign performance in Google Analytics.

URL

Contains, Does not contain, Is exactly, Is not

Recommend products based on the specific web address the users are currently browsing.


This is the example of a link visited by a customer from the welcome email sent by Attentive with the UTM paramters added.


https://antiquevase.myshopify.com/? utm_campaign=welcome_email& utm_content=VASE& utm_id=6060453& utm_medium=email& utm_source=attentive& utm_term=VASE


4. Geolocation


Type

Logic

Meaning

Country/region (Shopify markets)

Is any of, Is none of

Targets customers based on the specific localized storefront configured in the store's settings.

Country/region (Customer IP address

Is any of, Is none of

Targets customers based on their real-time geographical location via their internet connection.


Important things to remember when setting up conditions


  • There is no limit to the number of conditions you can set up
  • There are two LOGICS based on which CONDITIONS will trigger an ACTION


A. IF {condition A1} AND {condition A2} are matched, an ACTION will be triggered


Meaning: Both the conditions A1 and A2 should match for an action to set off.



B. IF {condition A1} AND {condition A2} OR IF {condition B1} AND {condition B2} is matched, an ACTION will be triggered


Meaning: One of the conditions, either A1+A2 or B1+B2, should match for an action to set off.



Actions


What are the actions you can configure to customize checkout recommendations?


ACTIONS are responses, in this case, product recommendation types and products recommended based on the specific attributes like types, collections, tags and vendors, that will be displayed when the conditions are matched.


A. Recommendations types


Type

Meaning

Frequently bought together

Product suggestions that are often bought together to fulfill a joint demand

Complements

Complementary items purchased at the same time by a large number of previous customers

Same product upsell

Similar products, cheaper or more expensive than the ones the shopper has bought

Similar products

Carousel or list of products that have similar attributes to the primary product, like color, price, size, etc

Bestsellers

The products from the store that have been sold the most

New arrivals

The products that have just been added to the store for sale

Manual selection

Manually choose the products from your catalog to be displayed as recommendations


To view the complete list of Actions supported by AfterShip Personalization, checkout this guide.



B. Product attributes


Type

Logic

Meaning

Product types

Contain any of

Recommend products based on the product types as defined in your Shopify store

Product tags

Contain any of

Recommend products based on the product tags as defined in your Shopify store. You can also reach out our support team to unlock popular AI-generated product tags for free.

Product vendors

Contain any of

Recommend products based on the product vendors as defined in your Shopify store

Product collections

Contain any of

Recommend products based on the product collections as configured in your Shopify store



Additional product filters


To narrow the selection of product recommendations during different pre and post-purchase scenarios, you can apply additional product conditions like product type, tags, price, vendors, collections, created date, and stock levels on the product recommendation type or attributes opted to be displayed when the pre-defined conditions are matched.



Type

Logic

Meaning

Product types

Contain any of, Contain all of

Product types as defined in your Shopify store will display here

Product tags

Contain any of, Contain all of

Product tags as defined in your Shopify store will display here. You can also reach out our support team to unlock popular AI-generated product tags for free.

Product collections

Contain any of, Contain all of

Product collections as configured in your Shopify store will display here

Product price

>, <, =, ≄, ≀

The price of the products that will be recommended



Important things to remember when setting up conditions


  • Only 1 action will be triggered for the {n} number of conditions defined
  • For manually selected product recommendations, you can choose as many products as you want from your catalog
  • Product displayed at checkout will be determined based on the combination of custom rules, product property(ies), product type pinned, and excluded products


Rule breakdown through an example



This single rule in the above screenshot is configured to display a specific set of accessories when a customer's cart meets certain criteria:


  • Rule Name: New Snowboards Collection
  • Conditions: The action is triggered IF all the following conditions are met:


a. The total number of products in the cart is greater than 10 (> 10).

b. The products in the cart contain any item with the specific product tag "Snowboard".


  • Action: When both conditions are true, the system will apply the Complete the look recommendation logic. This AI algorithm suggests complementary items that are often purchased together with the products already in the cart (Snowboard), in this case, items tagged as "Accessory".
  • Filter (Optional): The action is further narrowed by an additional filter: the recommended "Accessory" products must have a price greater than or equal to (≄) HK$ 3.
  • Exit if matched: The "Exit if matched" box is checked, meaning that if a customer meets these specific conditions, no other recommendation rules configured after this one will be considered or applied. 


This setup is designed to cross-sell accessories to customers making a large purchase of snowboards, improving the average order value (AOV) and customer experience with relevant suggestions.


Add fallback rule


fallback rule acts as a safety net in custom rules to ensure that a customer always sees a relevant selection of products, even if the primary recommendation rules cannot generate enough (or any) suggestions. 


  • The system first attempts to apply the main ruleset (e.g., the "New Snowboards Collection" rule in the example explained above).
  • If the primary rule fails to return a sufficient number of product recommendations, perhaps due to a new visitor with no browsing history, specific inventory limitations, or a technical issue, the fallback rule is automatically triggered.
  • Instead of displaying an empty space, the fallback rule will take precedence based on the Action configured like Frequently bought together products in the above example will be displayed if the Conditions are met.
  • You can apply additional filters to further narrow down the product recommendations results based on specific product properties like tags, types, collections, and price.





FAQs


1. Will the pinned products appear first despite the predefined custom rules?


Yes, no matter the number of custom rules you have configured for checkout order bump and post-purchase offer, the pinned product will always appear first, followed by the product recommendations.


Example: If the result (ACTION) of RULE I is ITEM 1 + ITEM 2 + ITEM 3, and the pinned product is ITEM 4, the product recommendations on the checkout and post-purchase page would be,


{pinned product} + {product recommendations of RULE I} = {ITEM 4} + {ITEM 1 + ITEM 2 + ITEM 3}



2. How does the exclusion rule work for the custom rules?


The products you have selected to be excluded from being recommended for checkout upselling will not show on the checkout and post-purchase page, even if they are the result of the custom rules set up by you.


Example: If the result (ACTION) of RULE I is ITEM 1 + ITEM 2 + ITEM 3, and the excluded product is ITEM 1, only ITEM 2 + ITEM 3 would show on the checkout page.


Reach our support team should you have any questions.

Updated on: 20/01/2026