Sitecore XP's personalization feature provides several rules for configuring personalization based on the history of the visitor's behavior when browsing to a page. In this article, we will explain how to configure each of these rules and how they work.
![](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F24q0mvn4woQdMwGRfyma4Z%2F1963fbc3f899674641b386e54fe8f909%2Fpersonalize01.png&w=3840&q=75)
Check the rules for the page
Narrowing down to the rules on the page will show some rules as follows.
![personalize01.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F24q0mvn4woQdMwGRfyma4Z%2F1963fbc3f899674641b386e54fe8f909%2Fpersonalize01.png&w=3840&q=75)
In this article, we will introduce two of these rules.
If you visit a specific page
Among the rules, try to set the following rules
- (Page) When you visit a specific page
The following is a screen that specifies the pages on the site as pages and the content to be displayed.
![personalize02.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F5Up1nJcGZZADYRYZDUb3Cc%2F1c1cf415314352d3f3215410762e36a1%2Fpersonalize02.png&w=3840&q=75)
Once the settings are complete, publish the item. If you have set up a workflow, complete the workflow and publish the item. Now let's check to see if the personalization is executed and the page about the meal is displayed when you browse to a specific page.
![personalize03.gif](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F1Nn7VjsZOpSp7PyVv9SGxi%2F12002066048dee1eb24eed5f02337aa5%2Fpersonalize03.gif&w=3840&q=75)
Personalization will take place, but once you close your browser, you will be returned to standard content. In other words, please understand that when using this rule, you can use it to refer to the page you are currently visiting.
Past and present interactions
So how can we set up a page event to say that a page was viewed, including past visits? In this case, you can create a page event and assign that event to the target page, so that when the page is viewed, the page event is recorded and the results can be used to personalize the page.
The rules include the following items
- If a specific page event was triggered in a past or current interaction, and if the number of days elapsed compares to the number, and if the number of past interactions compares to the number
This is what we will use in this case. The first step is to create a page event. The item is created under /sitecore/system/Settings/Analytics/Page Events where you add your Sitecore analytics settings.
![personalize04.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F3uT4RbrLH0Grnrsj3eqQR7%2F1ed8af17a60a8c4398c5621f5930711b%2Fpersonalize04.png&w=3840&q=75)
In this case, we will create an item called Personalize Test.
![personalize05.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F34uHPD0XWKGlUAfpzyAY3N%2Fc547a9dc4b8c45a32bc2e33f51527291%2Fpersonalize05.png&w=3840&q=75)
Creating an item alone does not make it valid; you must perform a workflow placement.
![personalize06.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F6mrV7PqR9YGEbs1jqsSbcV%2Fa032d160298a86377a441d8345fd136f%2Fpersonalize06.png&w=3840&q=75)
The page event has now been created.
Then select the item for which you want to set the browsing history, as the page event must be executed when the page is viewed. This time, specify in the content editor the item that has been specified for the previous page, and select the Analytics - Attributes item from the menu.
![personalize07.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F3KYCZ8ev3wPv5a4ApTgvsA%2F9d4dace78fd656ec43ebc488bb11230b%2Fpersonalize07.png&w=3840&q=75)
When the dialog opens, there is an Events tab that allows you to select the `Personalization Test` that you just created. Check this to complete the workflow for the page you have configured.
The previous steps have resulted in the publication of page events and pages that have been configured. Finally, create a rule. As before, open the Rules screen for personalization.
![personalize08.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F7nDRDPW1vh6B8MFQqeDdsY%2Fe3c71adf249cce5d157811b84bb6ffe9%2Fpersonalize08.png&w=3840&q=75)
This time, for testing purposes, we will change the content to be displayed when a different rule is hit than the previous one.
![personalize09.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F6SfjLMzpOfC6OiZhHiOXVv%2F4828ae8b7562e51a1a6c76dd5904193f%2Fpersonalize09.png&w=3840&q=75)
Complete the publishing process for the item whose settings have been changed and check its operation. We would like to use Experience Explorer for the operation check. The startup procedure is as follows
- Open the Experience Editor
- Open Home tab
- Switch to Explorer mode
![personalize10.gif](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F0YUGyMc4PHat8941Ys3DF%2Fdf9283ff2aea1c73294680ae824784f0%2Fpersonalize10.gif&w=3840&q=75)
In Explorer mode, you can set goals and events. If you open the panel closed on the right, by default there are no page events, as shown below.
![personalize11.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F4tYrbjURmVvXk9e740WReb%2F3a5a9d64388002bc8a453b70c04d12ec%2Fpersonalize11.png&w=3840&q=75)
If you open a page that has page events set up, you will see that data is given to the page events.
![personalize12.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F5n3P1W9gncrWUyZGna3YD2%2F8b87baf3205e9a7085322e9cb646d4ab%2Fpersonalize12.png&w=3840&q=75)
Returning to the home page, you will notice that the content has changed to Fitness.
![personalize13.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F5vBdXFZWXRJutmc5zXMEmt%2F4fb8e22fe57f0a8a8f9e54082348ec35%2Fpersonalize13.png&w=3840&q=75)
Operation check is complete. All that remains is to publish the relevant items to complete the personalization setup. The key point this time is that the personalization will change according to the duration and number of visits set in the rule. A page visit is only for that session, but to go beyond that, a page event will be used.
Summary
We have presented the steps for performing personalization using page browsing history. Both are similar, but the difference in operation is whether to target only during the visit or also the history of past actions.