Cart-Based Recommendation with Last Seen and Last Bought Exclusion

Published July 07, 2025
Modules
Difficulty

When building product recommendations in the checkout flow, it’s important to avoid redundancy and overexposure. Showing users items they’ve just viewed or recently bought can reduce relevance and lower conversion potential.

In this use case, we implement a recommendation that suggests products related to items currently in the cart. To ensure the results remain fresh and relevant, we apply the following filters:

  • one to exclude last seen products,
  • and another to exclude items recently purchased,
  • using product context – excluding the currently viewed product from recommendations
  • considering the product context – displaying recommendations from the same category as the currently viewed product.
    Note: You can refine the item context even more by displaying items in the same color, style, or size as the item currently viewed, using the available item attributes in your product feed.

What is more, we will use boosting factors, to promote in recommendations products which:

  • costs more than 10$. In this way, you exclude recommending products that are too cheap and encourage the purchase of more expensive ones.

This setup ensures that recommendations stay distinct from other modules on the page (like last seen or personalized offers) and avoid repeating content the user already interacted with — helping drive meaningful discovery and cross-sell opportunities. Additional boosting and filters let you present more personalized recommendations using the product context.

Prerequisites


Process


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

  1. Create an aggregate returning last seen products that returns the ID of the last seen product.
  2. Prepare an AI recommendation with the exclusion of last bought and last seen products.

Create an aggregate returning last seen products


In this part of the process, create an aggregate that returns the ID of the last 10 products a customer had visited. The recently viewed product itself will not display in the template, but will serve as a context for recommendations.

  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 Last Multi. As a size add 10. You can also add more results.
  5. From the Choose event dropdown list, select the Visited page event.
  6. As the event parameter, select product:retailer_part_no.
  7. Click the + where button.
  8. From the Choose parameter dropdown list, select the product:retailer_part_no parameter.
  9. From the Choose operator dropdown list, select Is true (Boolean).
  10. Using the date picker in the lower-right corner, set the time range to Last 7 days. Confirm your choice with the Apply button.
  11. Click Save.
The view of the aggregate configuration
Configuration of the aggregate returing the ID of the last seen product

Prepare an AI recommendation


In this part of the process, you will configure AI Recommendations which exclude last seen and last bought products. AI Recommendations will be added to the website to the product page.

  1. Go to Communication icon Communication > Recommendations > Add recommendation.

  2. Enter the name of the recommendation (it is only visible on the list of recommendations).

  3. In the Type & Items Feed section, click Define.

  4. From the Items Feed dropdown list, select an item feed.

  5. In the Type section, choose the Similar items recommendation type.

  6. Confirm the settings by clicking Apply.

  7. In the Items section, click Define. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 3. Define Static filters and Elastic filters. 4. In our case, in the Elastic filter section, click Define filter.
    5. Select Visual Builder.
    6. Click Select value. 5. Choose itemId. 6. As an operator, choose Not in. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select Aggregate. 8. From the list, choose the aggregate created in the previous part of the process. 4. Confirm by clicking Apply.

     <figure>
     <img src="/use-cases/all-cases/_gfx/elastic.png" alt="The view of the aggregate configuration"  class="large">
     <figcaption>Configuration of the elastic filter</figcaption>
     </figure> 
    
    1. In the Static filters section, click Define filter.

    2. Select Visual Builder.

    3. From the Select value dropdown list, choose category.

    4. As an operator, choose Equals.

    5. Click the icon which appeared next to the field with operator and from the dropdown list select Context (eye icon).

    6. From the Select value dropdown list, choose the category. Then, choose how you want to select your category level. In our case it will be Whole.

    7. Click and where to add another filter.

    8. From the Select value dropdown list, choose itemId.

    9. As an operator, choose Does not equal.

    10. Click the icon which appeared next to the field with operator and from the dropdown list, select Context (eye icon).

    11. From the Select value dropdown list, choose itemID.

    12. Confirm by clicking Apply.

      The view of the aggregate configuration
      Configuration of the static filter
    Note: You can refine the item context even more by displaying items in the same color, style, or size as the item currently viewed, using the available item attributes in your product feed.
  8. Define the boosting rules by clicking Define in the Boosting section.

    1. In Attributes section, click Add rule.
    2. Click Define rule.
    3. Choose Visual builder.
    4. From the Select value dropdown list, choose price.
    5. As Operator, choose More than.
    6. As the value, enter the minimum price a product should cost to be included in the recommendations. This way, you exclude recommending products that are too cheap and encourage the purchase of more expensive ones.
    7. Click Apply.
    8. Click Promote.
    9. In the Impact section, set the impact of this rule to High.
    The view of the aggregate configuration
    Configuration of the aggregate
  9. In the Additional settings section:

    1. Choose Exclude already bought products. If your company sells replenishable products, you can set exclusion for specific number of days, for example, exclude products bought not later than 30 days ago.
    2. To make sure that you only display available products in the recommendations, click Apply default filters.
  10. In the right upper corner, click Save.

Check the use case set up on the Synerise Demo workspace


You can check the configuration of each step directly in our Synerise Demo workspace:

If you’re our partner or client, you already have automatic access to the Synerise Demo workspace (1590), where you can explore all the configured elements of this use case and copy them to your workspace.

If you’re not a partner or client yet, we encourage you to fill out the contact form to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business.

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