Search isn’t only about retrieving results. Sometimes, depending on what the user searches for, you may want to display ads or promotional banners. This tutorial explains the process of setting up a Rule to trigger a banner image or a simple content.
NOTE: This requires front end development work to be in place to trigger the banner image. Check with your development team for that to be in place and reference the docs.
From the Merchandising Studio homepage:
Click the Merch tools link at the bottom of the left-hand navigation.
Click “Rules” in the left-hand navigation.
Continue to Step 2 of the tutorial below.
Algolia can only apply one Rule at a time (and, hence, display one banner). In case of multiple applicable banners, the precedence logic, ranked by importance, is as follows:
How does lexicographic order work?
If two letters are the same case, then alphabetic order is used to compare them. If two strings contain the same characters in the same positions, then the shortest string comes first.
Example:
An online IT hardware store has permanent banners for the following categories:
The store also has temporary offers and associated banners for the phrases/products:
The user starts on the Phones page (and can see the appropriate banner for that), then searches for “note”. For most stages, Huawei Honor Note 10, Xiaomi Redmi Note 10 Pro, and Samsung Galaxy Note 20 Ultra are tied and take precedence over the category banners. The final tie-breaking stage, invoked in this case, is Rule ID: this looks for the Rule with the smallest objectID, which in this case just happens to be for the Huawei Honor Note 10.
Note: It is a better practice to set Rule Object ID manually.
For example: { “objectID”: “harry-potter-rule” }