Recommendations


Product recommendation functionality allows you to include products selected by one of the supported algorithms based on customer preferences directly in message content.

Product recommendation functionality is only available when integration with the Loymax AI module is configured.

The general recommendation generation process works as follows:

  1. The marketer creates a recommendation in the Loymax Platform.
  2. The marketer inserts the recommendation code into a message.
  3. When generating the message, Loymax Smart Communications sends a request to Loymax AI for recommended products.
  4. Loymax AI returns an array of products generated using the specified algorithm.
  5. 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 (1.png).
  • Sort the table by any column (2.png).
  • Edit, copy, or delete a recommendation (3.png). 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:

  • Recommendation code — a short code used to insert recommendations into messages.
  • Recommendation name — a human-readable name displayed in the list of configured recommendations.
  • Recommendation algorithm — select the desired algorithm from the list:
    • Popular products. Algorithm that recommends the most popular products from the entire catalog, regardless of the customer’s history.
    • Popular products in category. Algorithm that recommends the most popular products from categories the customer has shown interest in (viewed, purchased, or ordered).
    • Similar products. Algorithm that recommends products similar to those the customer has shown interest in.
    • Frequently bought together. Algorithm that recommends products frequently purchased together with products the customer has shown interest in.
    • Personalized product recommendations. Algorithm that predicts a customer’s future purchases based on their history and recommends products accordingly.
    • Manual recommendations. Algorithm that recommends products based on category-matching rules without using the Loymax AI module.

Configure the recommendation parameters. The available parameters depend on the selected algorithm.

  • Number of recommendations — the number of products Loymax AI will return.
  • Calculate based on — the source from which Loymax Smart Communications will take products (for calculating recommendations using the Frequently bought together and Similar products algorithms) or categories (for calculating recommendations using the Popular products in category 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:

  • Recommend products based on region (1.png). Depending on this setting, recommended products will be filtered by the Region field either in the customer profile or in the customer’s latest web session.
  • Calculation period (2.png). The period over which receipts will be analyzed to identify products most frequently purchased together with the target products.
  • Calculate based on (3.png). As with other algorithms, this is the source from which Loymax Smart Communications retrieves target products.
  • Target category (4.png). 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.
  • Recommended category (5.png). 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.
  • Number (5.png). The number of products from this recommended category the algorithm will return. This number is set separately for each recommended category.
  • Advanced matching settings (6.png). 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).
  • For fields with numeric data types and the date data type, the Exact match checkbox is available. If enabled, a product will only be recommended if its value exactly matches the corresponding attribute of the target product.
  • For fields with string and boolean data types, exact matching is always required.
  • If the Exact match checkbox is disabled, a product will be included in recommendations if its attribute value differs from the target product’s value by no more than 15%.

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.

  1. 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.
{% set Rec=client.recommendations.sov_pok %}
{% if not Rec or Rec|length < 3 %}
  {% set Rec=client.recommendations.popular %}
{% endif %}
  1. 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.
  2. 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.
  3. 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 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 %}
  1. Split the filtered recommendations into groups of three.
  2. 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.
  3. For each product, display its name and image.
{% for batch in filteredRec|batch(3) %}
   {% if batch|length==3 %}
      {% for recommendation in batch %}
        {{ recommendation.name }}
        {{ recommendation.image_url }}
  1. 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."
{% 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 %}

The final construct will look like this:

{% set Rec=client.recommendations.sov_pok %}
{% 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 %}