Suggest items more expensive than customer's average purchase

Published October 28, 2022
Modules
Difficulty

AI search is a type of search engine that uses artificial intelligence to understand the userโ€™s intent and provide the most relevant results. Synerise AI search, lets you manage the behavior of the search engine for example by promoting specific products or adding specific circumstances, and also try out various configurations of the search engine by A/B tests.

AI Search not only can search relevant products in the feed based on custom rules but also provides the possibility of applying personalization and filters which can contain dynamic customer attributes such as aggregates and expressions.

This use case describes the process of calculating the average value of purchased items for a specific customer. Knowing this value, you will proceed to create a rule to present in the search results only those items whose price is above the average value a customers spent in the lat 30 days.

Prerequisites


Process


In this use case, you will go through the following steps:

  1. Create an aggregate to calculate the average value a customer spent in the last 30 days.
  2. Create a query rule (based on the aggregate created in the first step) that enforces showing in the search results only more expensive products than customer’s average purchase in the last 30 days.

Create an aggregate


In this part of the process, create an aggregate that returns the average value of products bought by an individual customer.

  1. Go to Analytics icon Analytics > Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter the name of the aggregate.
  4. Click Analyze profiles by and select Average.
  5. From the Choose event dropdown list, select the product.buy event.
  6. As the event parameter, select $finalUnitPrice.
  7. Define the period from which data will be analyzed. In our case it will be last 30 days.
  8. Save the aggregate.
Aggregate settings
Aggregate settings

Create a query rule


In this part of the process, create a query rule based on the aggregate created in the previous step. The rule will enforce showing in search results only the products which are more expensive than the average purchase of a customer.

  1. Go to AI Search icon AI Search > Indexes.
  2. Select an index from the list.
  3. Go to the Rules section.
  4. On the right side of the screen, click Add rule.
  5. Name the rule.
  6. To adjust the query conditions, in the Conditions section, click Define.
    1. Choose the All queries tab.
    2. Click Apply.
  7. To define how the search engine reacts to the defined conditions, in the Consequences section, click Define.
    1. Click Add consequence and choose Filter query results from the dropdown list.
    2. From the Attribute dropdown list, choose Price.Value.
    3. Choose the More than operator.
    4. In the left field, click the T icon and from the dropdown list, select Aggregate.
    5. From the list, choose aggregate created in the previous step.
    6. Enable the Mark as elastic option to make sure that the products more expensive than average value of products bought by a specific customer appear at the top of the search results. If you do not activate this option, search results will show only those products.
    7. Click Apply.
  8. In the Schedule section, you can define when the query rule applies.
  9. Click Save & Publish.
Query rule settings
Query rule settings

Check the use case set up on the Synerise Demo workspace


You can check the aggregate and query rule settings directly in Synerise Demo workspace.

If you don’t have access to the Synerise Demo workspace, please leave your contact details in this form, and our representative will contact you shortly.

Read more


๐Ÿ˜•

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

๐Ÿ˜‰

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker