Create a Rule
A rule allows you to create sophisticated logic that matches the right content to the right user. There are two types of rules: You can create Basic rules using a simple user interface, or Custom rules using your own Zephyr code. To create a rule using the Onsite Rule Builder
- From the Messaging menu, select Rules under Onsite.
- From the drop-down next to Add Rule, select Basic or Custom, then click Add Rule.
Create a Basic Rule
- Enter a Name for the rule.
- Choose an Algorithm that will be used to select the content from your feed or Content Library; content which can be unique for each user for whom your section is viewed.
- For algorithms that do not require a feed (and can source content directly from your Content Library), you’ll have the option to Restrict Content to Feed.
- Should your primary algorithm not return the desired number of recommendations, your Fallback Algorithm will be used to ensure the desired amount of content is provided.
- Enter the Number of Recommendations that should be produced.
- If you do not want to include as possible recommendations the items that the user has already purchased, select Hide Purchased Items.
Note: You may see another option to hide viewed items. If you wish to hide items a user has already viewed, select Hide Viewed Items.
- To view the Zephyr code produced by the rule, click View Zephyr.
- Click Save.
Create a Custom Rule
- Enter a Name for the rule.
- Enter custom Zephyr code. Be sure to include the personalize() function to retrieve content from your Content Library or feed, and produce a content array named recommendations, which will be available for use by the Zephyr in your HTML template or returned as JSON.
- Click Save.