Example use case
In this tutorial we use a common business use case as an example. We create a custom cookie that is used to personalize a component based on the number of times a user visits a specific page. On the assumption that more page visits mean an increasing interest in our product, we progressively display personalized components offering incentives and discounts to entice the user to make a purchase.
In this tutorial:
- We set a cookie named
- The cookie keeps count of the number of times a users visits the page.
- On first visit we serve generic content.
- On subsequent visits we serve different personalized content, offering progressively larger discounts.
Cookies can be used to create just about any kind of personalization feature and you can adapt the example to suit your needs or use it as inspiration for your own custom cookies.
Tutorial structure and work method
The tutorial uses the Enterprise Edition Pro demo bundle and is divided into two sections:
- Configuring a custom cookie trait: This is configured in the JCR in the Configuration app. It cannot be configured in YAML.
The best way to learn is to do it yourself, so we recommend that you recreate the tutorial from scratch and start by installing an EE Pro bundle.