Skip to content

Latest commit

 

History

History
97 lines (73 loc) · 6.69 KB

File metadata and controls

97 lines (73 loc) · 6.69 KB

AccuWeather API integration

Use Case

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.

Architecture Diagram

AccuWeather AI integration Architecture Diagram

How to Use the Sample Content

  • 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.

Technical Details

Compatibility

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.

Features built upon

The solution uses:

Manual installation

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

Manual content setup

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.

  1. Create a screens project
  2. Create a new sequence channel for the master sequence
  3. Edit the channel and add assets or components as needed.
  4. 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
  5. Click Save & Close to save your changes
  6. Edit the channel content and switch to Targeting mode
  7. Select Screens HowTo brand and Weather Based Campaign activity and hit the Start Targeting button
  8. Select the component for which you want to have targeted content
  9. Click the Target button to enable targeting for that component
  10. Define the content for each variation (default, Rainy or cloudy weather and Sunny weather) by selecting the variation in the Audiences in the side rail and adjusting the content as needed
  11. Switch then to Preview mode
  12. Expand the ContextHub which shows the current ASCII information (if not visible).
  13. The content will adjust depending on the weather in Basel
    • For now, no simulation is possible

Sample Content Links