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

# How to Personalize Website Based on User Affinity

# Introduction

As marketers, we want to personalize the website according to user’s affinity and display products that are relevant to the user. This helps improve two key metrics: conversion rate and user satisfaction.

In this article, we will use User Affinity and Web Personalization features of MoEngage to personalize an e-commerce website home page for fitness enthusiasts.

# Expected Result

Users will see the personalized web page according to their affinity.

<img alt="image-20240120-190548.png" src="https://mintcdn.com/moengage-user-guide/9ZDoUAfIV0lDtmVh/images/moengage_531b44.png?fit=max&auto=format&n=9ZDoUAfIV0lDtmVh&q=85&s=ebdb16d7482799075d781762edd79455" width="2880" height="1638" data-path="images/moengage_531b44.png" />

.

<Tip>
  * Events to track the action of a user searching for products, adding a product to cart or adding a product to wishlist, completing the purchase and each action’s related information such as the platform, product name, category, brand, price. To understand how to track events, refer to the [Developer Guide](/developer-guide/introduction).
  * Integration of the MoEngage Web SDK with your website to create a personalized web experience. For more information, refer to [Web Personalization](/developer-guide/personalize-sdk/sdk-integration/web-personalization-v2).
  * Ad blockers disabled in the browser. The personalization editor will not load if ad blockers are enabled.
</Tip>

# 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**, or click **+ Create new** > **Experience** > **Web**.
   <img alt="UC-88.png" src="https://mintcdn.com/moengage-user-guide/rDxK3ek_Jt3G54ss/images/moengage_7c44e0.png?fit=max&auto=format&n=rDxK3ek_Jt3G54ss&q=85&s=7a735f14605fc6185a72c557d59a4e47" width="1440" height="1288" data-path="images/moengage_7c44e0.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, "Dynamic Category Ordering".
   * **Experience Tags**: Add tags here to later identify this among the other personalized experiences you will be having.
     <img alt="image-20240120-182822.png" src="https://mintcdn.com/moengage-user-guide/RFCZY_YJ3dCN1QG7/images/moengage_f4db69.png?fit=max&auto=format&n=RFCZY_YJ3dCN1QG7&q=85&s=29263aad917024d4b0b44ed30b4a0b19" width="2744" height="1512" data-path="images/moengage_f4db69.png" />
3. Under **Target Audience**, click **+ Add Audience** and then click **+ New Audience** to define the target audience.
   <img alt="image-20240120-114653.png" src="https://mintcdn.com/moengage-user-guide/5njktjbootH54x8k/images/moengage_4d254d.png?fit=max&auto=format&n=5njktjbootH54x8k&q=85&s=997b0e65c60f7a325e195bf724724ece" width="2774" height="828" data-path="images/moengage_4d254d.png" />
4. The Add new audience pop-up is displayed. In the **Audience name** field, enter a name. For example, "Fitness Freaks".
5. Select the **Filter users by** option and click **User Affinity** tab to define audience based on users affinity.\
   **<img alt="image-20240120-183120.png" src="https://mintcdn.com/moengage-user-guide/HHTBNZYCcHVslmtq/images/moengage_63f8ad.png?fit=max&auto=format&n=HHTBNZYCcHVslmtq&q=85&s=beef05d36c56f0bc6cc4a4d4b6bae474" width="2744" height="1512" data-path="images/moengage_63f8ad.png" />**
6. For this example, we will define our affinity segments as the following:
   * Users who have searched predominantly in Fitness Category
   * Users who have searched predominantly in Formals
   * Users who have searched predominantly in Shorts
7. Search for the event "Product Searched" and then select **Predominantly** with Category as Fitness and then click **Add**. To know more about users affinity segments and the filters, refer [here](/user-guide/segment/segment-operations/affinity-segments).  **<img alt="image-20240120-183254.png" src="https://mintcdn.com/moengage-user-guide/z5wObluGBPTSzQMv/images/moengage_d67c9d.png?fit=max&auto=format&n=z5wObluGBPTSzQMv&q=85&s=daa492f76d568c0a314e04ad7be83651" width="2880" height="1626" data-path="images/moengage_d67c9d.png" />**
8. Follow steps 3 to 7 to define the other two possible categories "Formals" and "Shorts".  **<img alt="image-20240120-184107.png" src="https://mintcdn.com/moengage-user-guide/9pfqFCF9_E9B5Qla/images/moengage_e31044.png?fit=max&auto=format&n=9pfqFCF9_E9B5Qla&q=85&s=6bc7ee474ff91228d07d64a7c53f887d" width="2760" height="1526" data-path="images/moengage_e31044.png" />**
9. 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 alt="image-20240120-115200.png" src="https://mintcdn.com/moengage-user-guide/o-R_Ot8gzngW4Fxh/images/moengage_a168c7.png?fit=max&auto=format&n=o-R_Ot8gzngW4Fxh&q=85&s=d037f3cddfe6f0138daa9b1563612a29" width="2880" height="1622" data-path="images/moengage_a168c7.png" />**
2. Select the **Single page** option because the Category menu would most likely be in the Home page alone.
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 alt="2.png" src="https://mintcdn.com/moengage-user-guide/FL-P7uwjwPpxTJrP/images/moengage_9e7fe4.png?fit=max&auto=format&n=FL-P7uwjwPpxTJrP&q=85&s=9f78836158d62c0921d875fd82562321" width="1276" height="428" data-path="images/moengage_9e7fe4.png" />
4. Click **Personalize URL** to open our website in the editor.
   <img alt="3.png" src="https://mintcdn.com/moengage-user-guide/fX3Os5_VkJcQFtuv/images/moengage_479320.png?fit=max&auto=format&n=fX3Os5_VkJcQFtuv&q=85&s=e7a94b84cea01022942d4cf2e757f947" width="1272" height="488" data-path="images/moengage_479320.png" />
5. You are prompted to define the split of users—how many should see the personalized view of this experience.
6. Click **+ Variation** to add multiple variations if required and define the same. **<img alt="image-20240120-185728.png" src="https://mintcdn.com/moengage-user-guide/a7dojyyHAuCO-4Ba/images/moengage_5acf31.png?fit=max&auto=format&n=a7dojyyHAuCO-4Ba&q=85&s=c9b1d4aa88e77129ed9ba015a3e0f59a" width="2762" height="1538" data-path="images/moengage_5acf31.png" />**
7. Click **Personalize** for the required variation to open the website in the editor in a new tab.\
   **Note:** You can personalize the content for all variations except the **Default** variation.\
   **<img alt="image-20240120-184443.png" src="https://mintcdn.com/moengage-user-guide/nlxP2l2_fL5aQXAE/images/moengage_b9ff26.png?fit=max&auto=format&n=nlxP2l2_fL5aQXAE&q=85&s=646835427f6d64b7d58e4762df26573e" width="2880" height="1624" data-path="images/moengage_b9ff26.png" />**
8. Select any element in the loaded page to edit it. With this, you can perform changes from editing a name to introducing new elements.
9. After you select the element, the following buttons are displayed:
   <img alt="Screenshot 2024-01-20 at 6.03.48 PM.png" src="https://mintcdn.com/moengage-user-guide/nw5WUUQEvCMajwiY/images/moengage_935515.png?fit=max&auto=format&n=nw5WUUQEvCMajwiY&q=85&s=1096df1060d8f7cff85a256e18553478" width="398" height="58" data-path="images/moengage_935515.png" />
   **Note:** This option is available for all variations except the default variation and lets you personalize the content for each variation.
10. For our case, select the second option to edit the selected element. This will help us edit the HTML and thereby change the order of the list of categories using the HTML code.\
    **<img alt="image-20240120-184610.png" src="https://mintcdn.com/moengage-user-guide/6Cv-o-foj_xuv48L/images/moengage_c2cad3.png?fit=max&auto=format&n=6Cv-o-foj_xuv48L&q=85&s=1e526bad99458739bf2736c01828c5fd" width="2880" height="1624" data-path="images/moengage_c2cad3.png" />**\
    After you are done with editing the HTML code, the list will be something like this:\
    **<img alt="image-20240120-190025.png" src="https://mintcdn.com/moengage-user-guide/s2jfZa6amEeJ4PNc/images/moengage_a5fdf1.png?fit=max&auto=format&n=s2jfZa6amEeJ4PNc&q=85&s=1775047fa9db6f34ce3619626e567cdf" width="2880" height="1628" data-path="images/moengage_a5fdf1.png" />**
11. Click **Save & exit** at the top right.\
    **<img alt="image-20240120-185833.png" src="https://mintcdn.com/moengage-user-guide/7jgjNiC47PDmtibB/images/moengage_6f1c3a.png?fit=max&auto=format&n=7jgjNiC47PDmtibB&q=85&s=350d7a021519d6ecbd9b9fc18d912785" width="2880" height="1628" data-path="images/moengage_6f1c3a.png" />**\
    This will close this tab and take you back to the Experience definition page in the MoEngage dashboard.\
    **<img alt="image-20240120-190124.png" src="https://mintcdn.com/moengage-user-guide/Ce2t-4Btsc1sp6YW/images/moengage_9e2bf2.png?fit=max&auto=format&n=Ce2t-4Btsc1sp6YW&q=85&s=7e86c57647d5ea1704c5761133d0d60e" width="2758" height="1532" data-path="images/moengage_9e2bf2.png" />**
12. Do the same for the other audiences as well for two more times.
13. 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 alt="image-20240120-130725.png" src="https://mintcdn.com/moengage-user-guide/lhXvdjtPtl1U-hcS/images/moengage_94c523.png?fit=max&auto=format&n=lhXvdjtPtl1U-hcS&q=85&s=6849666132f03642206062f0402c3f42" width="2878" height="1624" data-path="images/moengage_94c523.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](/user-guide/personalize/client-side-personalization/client-side-personalization/create-client-side-personalization-experience).
4. Click **Publish**.

# Conclusion

In this use case, we used User Affinity and Web Personalization features of MoEngage to personalize an e-commerce website home page for fitness enthusiasts.

Now that we have published the personalized experience, head to the [Analyzing section](/user-guide/personalize/client-side-personalization/client-side-personalization/experience-analytics) to understand how your experience is performing.
