When setting your recommendation strategy, you can add filtering rules to customize the algorithm. You can do this by using Exclude or Include rules to guarantee that certain products are included or excluded from the widget, or you can use rules to Pin specific items to specific slots, regardless of whether they are relevant to the widget’s recommendation strategy.
Multiple filter rules
If you create more than one Include or Exclude rule, they are all applied as long as their conditions are met by the visitors, so it is important not to create conflicting Include and Exclude rules as they can yield unexpected or no results.
If you create more than one Pin rule, you can manage the rule priorities to determine which rule takes precedence.
Filtering rule types
Include: Ensure that only a subset of products is presented in selected slots of the widget. The included products are defined by conditions based on the product attributes. The products are returned in the order of the widget’s recommendation strategy. For example, you want a homepage widget to present only products for women, targeted to the Audience “Women”. The products for women are presented in the widget and ordered by the products’ popularity score.
Exclude: Ensure that a subset of products is not presented in selected slots of the widget. The excluded products are defined by conditions based on the product attributes. The products are returned in the order of the widget’s recommendation strategy. For example, you want a product page widget using the Similarity strategy not to present products that are priced at less than $20.00 for all users. The eligible products are presented in the widget and ordered by similarity to the currently viewed product.
Pin: Pin any product to a selected widget slot overriding the widget’s recommendation strategy. If a Pin Product rule conflicts with any other rule, the rule with the higher priority takes effect.
Note: Include and Exclude rules are not prioritized and are all enforced for users that conform to the rules’ targeting conditions. It is therefore important not to assign conflicting Only Include and Exclude rules, as they may yield unexpected or even empty results. For example: If the Only Include and Exclude rules from the previous examples are applied in the same widget, the widget would present only products for women that are also priced over $20.00 for users who belong to the Audience “Women”.
Create filtering rules
- The filter rules wizard is opened from different locations depending on which type of recommendation you are creating.
- For web and mobile recommendations, you open the wizard when defining the recommendation strategy (Settings › Strategies › Add New) by selecting the Add Filtering Rule option.
- For email recommendations, open directly from the list page (Email › Recommendations).
- For web and mobile recommendations, you open the wizard when defining the recommendation strategy (Settings › Strategies › Add New) by selecting the Add Filtering Rule option.
- In the Properties tab, set a name, add internal notes (optional), and set whether the rule should apply to all slots in the widget or only to a specific set of slots.
- In the Products tab, choose the rule type. Here you also determine the products that the filter is applied to. For example, if you select Exclude in the properties tab, you specify properties according to which products are excluded in this tab. Select Use real-time value to serve recommendations based on data obtained within the user's session.
Note: You can set a maximum of 10 Only Include rules in a single strategy, which each can have a maximum of 10 CONTAIN conditions and only 5 real-time value filters.
- In the Targeting tab, you can set conditions that determine which users are targeted.
Note: In API campaigns, all conditions are supported except for Product added to cart, Product purchased, and Product viewed. You can get the same functionality using custom attributes.
- The Schedule tab lets you define a start and end time for the rule.
Real-time values in custom rules
Use real-time values to create filters based on data obtained within a user's visit to the site or data that exists in your backend.
Custom rules based on Evaluators (site-personalization campaigns)
You must first create one or more Evaluators that are designed to retrieve required data (for example, a user or page property known only within the session, such as “total order price” or “delivery/pickup location”).
Custom rules based on custom attributes (Experience API campaigns)
You must first ensure your Experience API request contains the custom attribute (customAttribute) property within the API page attributes (pageAttributes) object. The benefit of using custom attributes is the ability to filter recommendations based on data that exists only in the server (for example, “basket gross-margin”).
When you select Use real-time value in the rule settings, a dropdown menu of the relevant evaluators or custom attribute appears.
Custom rules based on merge tags (Experience Email recommendation block)
Use real time filter. Enter your ESP merge tag that will insert the relevant value of this property to be filtered at email open time.
Real-time values notes and limitations:
- General:
- You can add up to 5 real-time filters to a rule.
- Real-time filters are available for Exclude and Include rules (not Pin).
- In the case of bad syntax or inability to fulfill the rule, the recommendation request is processed and the rule is ignored.
- Evaluators:
- Evaluator processing requires some extra time. If the real-time recommendation is not processed before the timeout (maximum 4 seconds), the rule is ignored.
- Custom attributes:
- Custom attributes can't pass ‘NULL’ .
- In the case of an empty custom attribute, pass an empty string (“”) to avoid rule failure
- The custom attribute is type sensitive. Make sure strings and numbers values are passed correctly.