> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Show Recently Viewed Products on Website

# Introduction

In today's competitive landscape, the ability to recommend products or services precisely tailored to the customers' needs and preferences based on their current browsing behavior is a powerful tool. Displaying recently-viewed products on a website is important for numerous advantageous reasons:

* **Recollection**: It helps users remember the products they have shown interest in. People may browse numerous items before making a purchasing decision, and may easily forget the products they previously viewed. A recently viewed section aids in jogging their memory.
* **Convenience**: It saves customers time because they don't need to search the whole website again to find a product they were previously interested in. It makes the customer journey more convenient.
* **Personalized User Experience**: Displaying recently-viewed products provides a personalized shopping experience. It shows that the platform is paying attention to the user's interests.
* **Increase in Sales**: Products recently viewed, but not purchased immediately, can indicate a hesitance or indecision on the customer's part. Reminding them of their incomplete purchase may prompt a decision, leading to an increase in sales. This is often referred to as reducing 'view abandonment'.
* **Improved Customer Retention**: By tailoring the shopping experience to user's tastes and preferences, businesses can boost customer satisfaction and increase the likelihood of return visits and customer loyalty.

In this article, we will see how you can achieve the same using the powerful combination of MoEngage Personalize and Recommendations.

# Expected Result

Users will see the personalized recommendations with product grids based on what they viewed recently.

<img src="https://mintcdn.com/moengage/prFQLkdcYp4xSt9t/images/moengage_65fb84.png?fit=max&auto=format&n=prFQLkdcYp4xSt9t&q=85&s=0a73823a50e0c13b2befca6476f71d73" alt="ProductGrid.png" width="2068" height="887" data-path="images/moengage_65fb84.png" />

<Tip>
  * Events to track user activity on a website through MoEngage Web SDK must already be configured. To understand how to track events, refer to the [Developer Guide](/docs/developer-guide/introduction).
  * Integration of the MoEngage Personalize SDK with your website to create a personalized web experience. For more information, refer to the [Personalize SDK Integration Guide](/docs/developer-guide/personalize-sdk/sdk-integration/web-personalization-v2).
  * A catalog listing all your products must be uploaded on the MoEngage dashboard. For more information, refer to [Catalogs](/docs/user-guide/content/recommendations/prerequisites/catalogs).
  * Mapping of the user actions to standard MoEngage actions on the MoEngage dashboard. This mapping helps us in understanding the action and thus run our recommendation models and in querying models to create an expected output. For more information, refer to [Map User Actions Settings](/docs/user-guide/content/recommendations/prerequisites/map-user-actions-settings).
</Tip>

# Create a Recommendation

In this section, let us create a recommendation based on the users action:

1. Navigate to the MoEngage Dashboard and select **Content** > **Recommendations** from the left navigation. The Recommendations page is displayed. For more information, refer to [Creating User Action Recommendations](/docs/user-guide/content/recommendations/basic-recommendations/user-actions-model).
2. At the top right corner, click **+ Create recommendation**. It takes you to the first step "Select recommendation model".
   <img src="https://mintcdn.com/moengage/ncl4TtlD4tqnPefh/images/moengage_69618f.png?fit=max&auto=format&n=ncl4TtlD4tqnPefh&q=85&s=53082429ae52c6e194971aa2d521a3c9" alt="2.png" width="5440" height="2714" data-path="images/moengage_69618f.png" />
3. In the **Filter by user action and item attributes** section, select the **User Actions** model.
4. Click **Next**. It takes you to the second step "Create recommendation". Enter the following details:
   * **Recommendation name**: Enter a name for the recommendation. For example, "Recently Viewed Products". This will be the name through which you will refer the output of this recommendation model.
   * **Recommendation description**: Enter a description for the recommendation. This description will help you understand what the model is aimed at.
   * **Catalog**: Select the catalog that has all the list of products provided in your platform with all the related information.
     <img src="https://mintcdn.com/moengage/CaPmX0z_ys8cr0ms/images/moengage_0834d2.png?fit=max&auto=format&n=CaPmX0z_ys8cr0ms&q=85&s=42348f21f0715460ec2201ad41140d14" alt="12.png" width="2726" height="760" data-path="images/moengage_0834d2.png" />
5. In the **Filter recommendations by user actions** section, filter the products that the user has viewed recently but not purchased.
   1. From the **Item where user performed** drop-down list, select “Product Viewed”.
   2. Select the **Exclude** checkbox.
   3. From the **Item where user performed** drop-down list under **Exclude**, select “Product Purchased”.
      <img src="https://mintcdn.com/moengage/SBG7um9Fqotw1CFo/images/moengage_b51d4b.png?fit=max&auto=format&n=SBG7um9Fqotw1CFo&q=85&s=7fec4da9413aa2d93d0ac563d8607914" alt="4.png" width="5382" height="2326" data-path="images/moengage_b51d4b.png" />
      This query provides the list of products that a user has viewed recently in the last 10 days but has not purchased in the last 10 days.
   4. In the **Sort the filtered items** section, from the **Order results by** drop-down list, select "Most Recent".
6. Click **Create** to save the changes and create the recommendation. The status of the same will be "Active" on the Recommendations page.
7. The Recommendation engine shares the set of products user has viewed but not purchased in the last 10 days, sorted by the recency.

Now that the recommendation is created, let us create a personalized experience to nudge people about the products that they have viewed but not purchased.

# Create a Personalized Experience

In this section, let us create a personalized experience that you would like your users to have have in your website.

## Step 1: Target Users

1. Navigate to the sidebar on the left and click **Personalize** **>** **All Experiences** and click **+ Experience** > **Web (WYSIWYG)** or click **+ Create new** > **Experience** > **Web** > **Web (WYSIWYG)**.
   <img src="https://mintcdn.com/moengage/7H2dU4CG2W0DQCPI/images/moengage_6e976d.png?fit=max&auto=format&n=7H2dU4CG2W0DQCPI&q=85&s=61c15762897cb39365902e0f95a0b8aa" alt="UC-88.png" width="1440" height="1288" data-path="images/moengage_6e976d.png" />
   You are taken to the first step "Target users" of defining a personalized experience.
2. Enter the following details:
   * **Experience name**: A name for the personalisation you are building. For example, "Display Recently Viewed Products".
   * **Experience Tags**: Add tags here to later identify this among the other personalized experiences you will be having.
     <img src="https://mintcdn.com/moengage/N1a7P_mcSpm-5bMa/images/moengage_59c3e0.png?fit=max&auto=format&n=N1a7P_mcSpm-5bMa&q=85&s=5304109991dab968eff0b7474c8b27b0" alt="7.png" width="1054" height="590" data-path="images/moengage_59c3e0.png" />
3. Under **Target Audience**, click **+ Add Audience** and then click **+ New Audience** to define the target audience. For more information on new audience creation, [refer here](/docs/user-guide/personalize/client-side-personalization/client-side-personalization/create-client-side-personalization-experience).
   <img src="https://mintcdn.com/moengage/60BzFdXTJDO5dnCb/images/moengage_3355c0.png?fit=max&auto=format&n=60BzFdXTJDO5dnCb&q=85&s=63dc09d2a26ef579f463ac3d39a86b76" alt="image-20240120-114653.png" width="2774" height="828" data-path="images/moengage_3355c0.png" />
4. Click **Next** to move to the second step "Content" where you can define the content that will go into your campaign.

## Step 2: Content

1. Clicking **Next** in the first step "Target users" will display the URL(s) to personalize pop-up. We can use this to define where we would like to show the defined personalization in our website.\\
   <img src="https://mintcdn.com/moengage/fUSb9kG75-iJ0JuL/images/moengage_e55131.png?fit=max&auto=format&n=fUSb9kG75-iJ0JuL&q=85&s=5fc861e76f464dd315e408769803edda" alt="image-20240120-115200.png" width="2880" height="1622" data-path="images/moengage_e55131.png" />
2. You can personalize either a single web page or multiple web pages.\
   **Note**: In case of multiple web pages, the elements to be personalized must be present on every page matching the web page filtering criteria. If the element is not present, the personalization will not be shown to the user.
3. In the **URL** field, enter the URL on which we will do the setup and click **Verify SDK setup**. This will check if the SDK is installed in the pages.
   <img src="https://mintcdn.com/moengage/o0kXRAcOq2mxzDnY/images/moengage_efdb41.png?fit=max&auto=format&n=o0kXRAcOq2mxzDnY&q=85&s=8244ab336204822bf5fee229deecf3a4" alt="2.png" width="3162" height="1224" data-path="images/moengage_efdb41.png" />
4. Click **Personalize URL** to open our website in the editor.
5. Click **Personalize** for the required variation to move to the next step of personalizing the webpage using the What-You-See-Is-What-You-Get (WYSIWYG) visual editor of MoEngage in a new tab.\
   **Note:** You can personalize the content for all variations except the **Default** variation.
   <img src="https://mintcdn.com/moengage/ME-DtlELD2N8TrcF/images/moengage_c00ac7.png?fit=max&auto=format&n=ME-DtlELD2N8TrcF&q=85&s=417b57541a079b8cbd2096738fa59d4e" alt="3.png" width="5480" height="1724" data-path="images/moengage_c00ac7.png" />
6. Select the location on your target webpage(s) and click **+ Add widget** . The Select widget panel is displayed on the right.
7. Click **Product grid** in the editor.
   <img src="https://mintcdn.com/moengage/VqQHPleQ9qk_ZsLR/images/moengage_548e3f.png?fit=max&auto=format&n=VqQHPleQ9qk_ZsLR&q=85&s=fb479ab6bc74a7193d7f94f36a79b8c3" alt="4.png" width="3804" height="1940" data-path="images/moengage_548e3f.png" />
8. Follow the detailed instructions in this [document](/docs/use-cases/personalize/recommend-personalized-products-using-product-grids) to configure and personalize your grid. When you map information, from the **Choose your recommendation** drop-down list, select the recommendation "Recently Viewed Products" you created [above](#create-a-recommendation).
9. Click **Next** to move to the third step "Schedule and goals" where you can define the schedule and goal of your experience.

## Step 3: Schedule and Goals

1. In the **Send experience** section, select **Active continuously** and define when to start and end this experience.
   <img src="https://mintcdn.com/moengage/P9B7WlDoMUnquME5/images/moengage_0a9446.png?fit=max&auto=format&n=P9B7WlDoMUnquME5&q=85&s=86b2f46c093f9e4b4d529416e7b272d5" alt="image-20240120-130725.png" width="2878" height="1624" data-path="images/moengage_0a9446.png" />
2. In the **Conversion goals** section, define the conversion goal based on your requirements.
3. Under **Delivery controls**, from the **Experience Priority** drop-down, select a priority. For more information, refer to [Create Experience](/docs/user-guide/personalize/client-side-personalization/client-side-personalization/create-client-side-personalization-experience).
4. Click **Publish**.

# Conclusion

Whenever the visitors fulfil the criteria specified for the target audience, they would see the product grid widget on the web page(s) after they perform the custom event. For example, product viewed, product added to cart, or product wishlisted.

Recently Viewed products displayed on the home page:

<img src="https://mintcdn.com/moengage/xGyg9rXr6djolSrt/images/moengage_dbdf2a.png?s=0712562909af75170aab311d533283dc" alt="Product grids based on browsing behavior.gif" width="1280" height="660" data-path="images/moengage_dbdf2a.png" />

Now that you have personalized a visitor’s current session based on browsing behavior, go to [Persoanlize Analytics](/docs/user-guide/personalize/client-side-personalization/client-side-personalization/experience-analytics) to see how your experience is performing.
