Acme Corp is a multinational fast-food franchise. The company delivers content which is personalized based on the current weather in each location: if the weather is sunny, it might promote ice creams while when it is rainy or cold, it might promote hot coffee.
This how-to project walks you through how to achieve personalized content based on weather (provided by www.accuweather.com).
The project leverages AEM personalization which includes the ContextHub, the Segmentation engine and the Content Targeting UI.
Warning: the project contains a demo apikey to connect to Accuweather APIs. It must be replaced by your own key for non-demo usage of the code. You can edit the apikey in the AccuWeather store config.
- Video recording showcasing the use case
- Open the channel with content based on weather
- Switch to Targeting mode
- Select Screens HowTo brand and Weather Based Campaign activity and hit the Start Targeting button
- Explore the different content variations by switch the different Audiences
- Content can be edited per variation
- Switch then to Preview mode
- Expand the ContextHub which shows the current weather information: content displayed in the channel is the content defined for the current weather. For now, no simulation is possible and location is hardcoded to be Basel.
| AEM version | Compatibility | Comments |
|---|---|---|
| 6.3 | ✅ | |
| 6.4 | ❗ | While weather based content should be working, some bugs have been raised regarding segments authoring and ContextHub administration. |
The solution uses:
- the ContextHub
- the Segmentation engine
- the Content Targeting UI
- a standard Sequence Channel
This module requires HowTo project and is part of the install process. Follow instructions here.
If you still want to install the module individually, you can run:
mvn clean install content-package:install
Start by familiarizing yourself with the concept of Personalization and Authoring Targeted Content Using Targeting Mode for Sites.
Note that we won't be describing how to create the custom ContextHub Store and its Content Targeting UI, nor the Personalization Segments and Personalization Audiences setup as the steps will vary in the various AEM versions and links to the documentation have been provided above in the Features built upon section.
- Create a screens project
- Create a new sequence channel for the master sequence
- Edit the channel and add assets or components as needed.
- Edit the channel properties and click the Personalization tab
- set ContextHub Path to
/etc/cloudsettings/screens-howto/contexthub - set Segments Path to
/etc/segmentation/contexthub/screens-howto
- set ContextHub Path to
- Click Save & Close to save your changes
- Edit the channel content and switch to Targeting mode
- Select Screens HowTo brand and Weather Based Campaign activity and hit the Start Targeting button
- Select the component for which you want to have targeted content
- Click the Target button to enable targeting for that component
- Define the content for each variation (default,
Rainy or cloudyweather andSunnyweather) by selecting the variation in the Audiences in the side rail and adjusting the content as needed - Switch then to Preview mode
- Expand the ContextHub which shows the current ASCII information (if not visible).
- The content will adjust depending on the weather in Basel
- For now, no simulation is possible
- Content
- Rules / Segments (access: Navigation > Personalization > Audiences)
- ContextHub (access: Tools > Sites > ContextHub > screens-howto > ContextHub Configuration)
- AccuWeather store
- AccuWeather store config - the config contains the Accuweather id of the Basel location. this could be changed to another location (path property of the config).
- AccuWeather module
- AccuWeather module config
