Category recommendations allow you to shorten the conversion path, so customers reach products in fewer steps and are less likely to resign. By presenting top category recommendations, the path to the product is shortened significantly.  

This use case illustrates how to dynamically display a recommendations related to the last main category visited by the user — for example, if the customer recently viewed "Electronics" furniture, a banner or content block can highlight top products from that specific category. This approach increases the chance of re-engagement and encourages return visits or immediate conversions by matching promotional content to current user interest.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

In this use case, we return top recommendations based on the last visited main category by the user. However, the same configuration logic can be easily adapted to display category-specific recommendations directly on each category page.

To do this, you simply skip the use of segments and aggregates related to browsing history and instead implement static personalization rules per category. For example, on the “Electronics” category page, you display recommendations from electronics category. This approach allows for consistent and relevant recommendatons across the entire website structure.

</div></div></div>


## Prerequisites
---
- [Import your product feed to catalog](/use-cases/import-product-feed-to-catalog).
- [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable the personalized recommendation model.
- Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://developers.synerise.com/DataManagement/DataManagement.html#operation/CreateATransaction).

## Process
---

1. [Create an aggregate](/use-cases/personalized-category-reco#create-an-aggregate) for the last visited category.
2. [Create a recommendation](/use-cases/personalized-category-reco#create-a-recommendation) for each category 

## Create an aggregate
---
In this part of the process, create an aggregate that will return the category that the user last visited.

1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/behavioral-data-hub-icon.svg" alt="Behavioral Data Hub icon" class="icon"> **Behavioral Data Hub > Live Aggregates > Create aggregate**.
2. As the aggregate type, select **Profile**.  
2. Enter the name of the aggregate.
3. Click **Analyze profiles by** and select **Last**.
5. From the **Choose event** dropdown list, select the `page.visit` event.
6. As the event parameter, select **category**.
7. Add the value **product:retailer_part_no**. 
8. As the value add **Is true**.
7. Set the period from which the aggregate will analyze the results to **Lifetime**. 
12. Save the aggregate.

<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/lastvsitedcategoryaggregate.png" class="full" alt="The view of the configuration of the aggregate">
<figcaption>Configuration of the aggregate</figcaption>
</figure>

## Create a recommendation
---
1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/ai-hub-icon.svg" alt="AI Hub icon" class="icon" > **AI Hub > (AI Recommendations) Models > Add recommendation**.
3. In the top left corner, enter the name of your recommendation.
4. In the **Type & Items feed** section, click **Define**.
5. From the **Items feed** dropdown menu, choose the provided feed.
6. Choose the **Top** recommendation type.
7. From the dropdown menu that appear at the bottom, choose your **Metadata catalog**.
8. Click **Apply**.
9. In the **Items** section, click **Define**.
11. Define the minimum and maximum number of brands that will be recommended to the user.  
13. Define **Static filter**. Choose **Visual builder**.
6. From the **Select value** drop-down list, select **category**.
6. As an operator, choose **Equals**.
7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Aggregate**. 
8. Choose the [aggregate, created in the previous step](#create-an-aggregate)
13. In the **Category level** input area that appear, define the category level as a numeric value. In our case choose **Take first (1).**
    
    <div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

    If your products categories have a `X > Y > Z` structure, level 0 will be `X > Y > Z`. Level 1 will be `X > Y` and so on. Here, you define how granular the category recommendations will be. For example, if you are selling shoes, you will have a `Outdoor > Sport > Running` category and a `Outdoor > Sport > Football` category. If level 0 is provided, both categories can be recommended. If level 1 is provided `Outdoor > Sport` category will be recommended to the user.

    </div></div></div>
 
13. Choose **Fail slot** - in this case, if the filter is missing the slot of recommendations will not be visible. So if the user does not have any last time visited category because it is his first visit, this slot of recommendations will not be visible for him.

    <figure>
 <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/use-cases/all-cases/_gfx/lastvsitedcategoryfilter.png" class="full" alt="The view of the configuration of the recommendations">
 <figcaption>Configuration of the recommendations</figcaption>
 </figure>

14. Click **Apply**.
15. In the **Items sorting method within slots** section, select your desired item sorting method within slots. In our case choose Items sorting method: **Page visit count in the last 30 days**.
1.  In **Boosting**, you can enable [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors).
13. In **Additional settings**, optionally you can exclude already bought products and set a metric to sort by. 
14. Save the recommendation by clicking **Save**. 
15. In the top right corner, click **Save**

## What's next
---
You can display the recommendation on your home page by using [dynamic content](/docs/campaign/dynamiccontent).  

1. Go to **Experience Hub > Dynamic content > New dynamic content**.  
2. In the body of the dynamic content, use the promotion insert.  
    
   <div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   Read more about how to use promotion in inserts [here](/developers/inserts).

   </div></div></div>

3. Add CSS and/or HTML to the dynamic content.
4. [Define the rest of the settings](/docs/campaign/dynamiccontent/creating-dynamic-content).

## Check the use case set up on the Synerise Demo workspace
---
You can check the [aggregate](https://app.synerise.com/analytics-v2/aggregates/78b590fc-88bd-3831-8419-5c080efceeec), and [recommendation configuration](https://app.synerise.com/ai-v2/recommendations/uBqe0jFEtUxK) directly in 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](https://demo.synerise.com/request) 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
---
- [Dynamic content](/docs/campaign/dynamiccontent)
- [Recommendations](/docs/ai-hub/recommendations-v2)