Recommendations
Product recommendation functionality allows you to include products selected by one of the supported algorithms based on customer preferences directly in message content.
Contents:
The general recommendation generation process works as follows:
- The marketer creates a recommendation in the Loymax Platform.
- The marketer inserts the recommendation code into a message.
- When generating the message, Loymax Smart Communications sends a request to Loymax AI for recommended products.
- Loymax AI returns an array of products generated using the specified algorithm.
- Loymax Smart Communications sends a personalized message containing the recommendations.
Creating recommendations using Loymax AI algorithms
To view the list of created recommendations, go to the Recommendations section in the left-hand panel.
|
The following actions are available in the Recommendations section:
- Create a new recommendation (
). - Sort the table by any column (
). - Edit, copy, or delete a recommendation (
). You can also edit a recommendation by clicking its code or name.
Clicking the button to create a new recommendation or edit an existing one opens the recommendation editing window.
Fill in the required recommendation fields:
Configure the recommendation parameters. The available parameters depend on the selected algorithm.
|
|
Creating manual recommendations
Manual recommendations differ from all other algorithms in that the calculation is performed entirely within Loymax Smart Communications. Manual recommendations are calculated once per day according to the configured parameters. When calculating manual recommendations, the system checks the specified source (Calculate based on field) for products belonging to the defined Target category. Then, the system selects products from Recommended categories that most frequently appear together with the target product in receipts. The algorithm returns N of the most popular products, where N is the value set in the Number field. Recommendations can be further restricted: if Advanced matching settings are defined, the algorithm will only suggest products whose parameter values match those of the target product. The following settings are available for manual recommendations:
|
|
Inserting recommendations into messages
To display recommendations in messages, you must use template engine constructs.
Consider an example of adding recommendations to a message. An email campaign needs to be sent to customers with recommendations using the Frequently bought together algorithm (a recommendation with code sov_pok has been created in the system for this purpose). For customers without sufficient purchase history, recommendations will be provided using the Popular products algorithm (a recommendation with code popular has been created in the system for this purpose).
The email layout assumes displaying 3 to 9 product cards—1 to 3 rows of 3 cards each. Only products available for ordering in the online store should be recommended. Additionally, the product price must be displayed in the message, and if the price has changed, both the old and new prices should be shown.
- Define a variable Rec and assign it an array of Product (product) objects selected by the Frequently bought together algorithm. If the customer hasn’t made enough purchases, fall back to the Popular products algorithm.
{% if not Rec or Rec|length < 3 %}
{% set Rec=client.recommendations.popular %}
{% endif %}
- Filter the array of recommended products to keep only those available for purchase in the online store (the boolean custom field eComAvailable equals true). To do this, define a variable filteredRec to store the filtered recommendations.
- No more than 9 products (three rows of three) should be displayed in the message. Define a variable count_recs as a counter: each time a product is added to the filtered recommendations array, increment the counter by 1.
- Iterate through all products and add to the array only those that haven’t already been added (in case Loymax AI returned the same product twice) and that are available for ordering in the online store. Also, check the counter value and add the product only if fewer than 9 recommendations have been collected.
{% set filteredRec=[] %}
{% for product in Rec %}
{% if product not in filteredRec and product.eComAvailable=='Y' and count_recs < 9 %}
{% set filteredRec=filteredRec|merge([product]) %}
{% set count_recs=count_recs + 1 %}
{% endif %}
{% endfor %}
- Split the filtered recommendations into groups of three.
- If the filtering process results in a number of suitable products not divisible by 3, the last group will contain fewer than 3 products (e.g., 7 = 3 + 3 + 1). Check and display only those groups containing exactly three products.
- For each product, display its name and image.
{% if batch|length==3 %}
{% for recommendation in batch %}
{{ recommendation.name }}
{{ recommendation.image_url }}
- Next, implement the following logic:
- If the product price has changed (current online store price and old price fields are not equal), display both the old and new prices;
- If the price hasn’t changed and the online store price field is populated, display the current price;
- If the online store price field is empty, display "Price to be confirmed."
Price: {{ recommendation.priceim }}
Old price: {{ recommendation.oldprice }}
{% elseif recommendation.priceim %}
Price: {{ recommendation.priceim }}
{% else %}
Price to be confirmed
{% endif %}
{% endfor %}
The final construct will look like this:
{% if not Rec or Rec|length < 3 %}
{% set Rec=client.recommendations.popular %}
{% endif %}
{% set count_recs=0 %}
{% set filteredRec=[] %}
{% for product in Rec %}
{% if product not in filteredRec and product.eComAvailable=='Y' and count_recs < 9 %}
{% set filteredRec=filteredRec|merge([product]) %}
{% set count_recs=count_recs + 1 %}
{% endif %}
{% endfor %}
{% for batch in filteredRec|batch(3) %}
{% if batch|length==3 %}
{% for recommendation in batch %}
{{ recommendation.name }}
{{ recommendation.image_url }}
{% if recommendation.priceim and recommendation.oldprice and recommendation.priceim != recommendation.oldprice %}
Price: {{ recommendation.priceim }}
Old price: {{ recommendation.oldprice }}
{% elseif recommendation.priceim %}
Price: {{ recommendation.priceim }}
{% else %}
Price to be confirmed
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}


). The category containing products for which recommendations will be calculated. To add a target category, click + Add match in the bottom-left corner of the window.
). The category containing products that will be recommended. Multiple recommended categories can be selected for a single target category. To add a recommended category, click + Add category.
). Click + Add match in the right part of the window to add a field by which the algorithm’s output should be filtered. Advanced matching settings are defined separately for each target category (i.e., they apply to all recommended categories).