Configuring ContextHub in AEM Screens configuring-contexthub-in-aem-screens
This section emphasizes on creating and managing data driven asset changes using a a data store.
Key Terms key-terms
Before we get into the details of creating and managing inventory driven channels in your AEM Screens project, you must learn few of the key terms that are important and relevant to the different scenarios.
Brand Refers to your high level project description.
Area Refers to your AEM Screens project name such as Digital Ad Signage
Activity Defines the rule category such as Inventory-Driven, Weather-Driven, Department Availability-Driven, and so on.
Audience Defines the rule.
Segment Refers to the version of the asset to play for the given rule such as if the temperature is below 50 degrees fahrenheit, then the screen displays an image of a hot coffee otherwise a cold drink.
The following diagram provides a visual representation of how ContextHub Configurations coincide with Activity, Audience, and Channels.
Preconditions preconditions
Before you start configuring Context Hub Configurations for an AEM Screens project, you must set up Google Sheets (for demonstration purposes).
Step 1: Setting up a Data Store step-setting-up-a-data-store
You can set up the data store as a Local I/O event or as a local database event.
The following asset level data triggers example showcases a local database event that sets up a data store such as an excel sheet that allows you to use ContextHub configurations and segments path to AEM Screens channel.
Once you have set up the google sheet correctly for example as shown below:
The following validation is what you will view when you check your connection by entering the two values, google sheet ID and API key in the format below:
https://sheets.googleapis.com/v4/spreadsheets/<your sheet id>/values/Sheet1?key=<your API key>
Step 2: Setting up Store Configurations step-setting-store-configurations
-
Navigating to ContextHub
Navigate to your AEM instance and click the tools icon from left sidebar. Click Sites –> ContextHub, as shown in the figure below.
-
Creating a new ContextHub Store Configuration
-
Navigate to the configuration container titled as screens.
-
Click Create > Create Configuration Container and enter the title as ContextHubDemo.
-
Navigate to ContextHubDemo > Create ContentHub Configuration and click Save.
note note NOTE After you click Save you will be in the ContextHub Configuration screen. -
From the ContextHub Configuration screen, click Create > ContentHub Store Configuration…
note caution CAUTION As part of AEM 6.5 Feature Pack 4 or AEM 6.4 Feature Pack 8, customers should update /conf/screens/settings/cloudsettings
tosling:Folder
.Follow the steps below: - Navigate to CRXDE Lite and then to
/conf/screens/settings/cloudsettings
. - Check if
cloudsettings jcr:primaryType
is insling:Folder
. If thejcr:primaryType
is not insling:folder
, proceed to the next steps. - Right click on
/conf/screens/settings
and create a new node with name as cloudsettings1 and Type as sling:Folder and save the changes. - Move all the nodes under
/conf/screens/settings/cloudsettings
tocloudsettings1
. - Delete
cloudsettings
and save. - Rename
cloudsettings1
tocloudsettings
and save. - You should now observe that /conf/screens/settings/cloudsettings has
jcr:primaryType
assling:Folder
.
You should follow these steps in author and publish before or after the upgrade. - Navigate to CRXDE Lite and then to
-
Enter the Title as Google Sheets, Store Name as googlesheets, and Store Type as contexthub.generic-jsonp and click Next.
note caution CAUTION If you are using Adobe Experience Manager (AEM) 6.4, enter the Configuration Title as googlesheets and the Store Type as contexthub.generic-jsonp. -
Enter your specific json configuration. For example, you can use the following json for demo purposes and click Save and you will see the store configuration titled as Google Sheets in ContextHub configuration.
note important IMPORTANT Make sure to replace the code with your <Sheet ID> and <API Key>, that you fetched while setting up the Google Sheets. code language-none { "service": { "host": "sheets.googleapis.com", "port": 80, "path": "/v4/spreadsheets/<your google sheets id>/values/Sheet1", "jsonp": false, "secure": true, "params": { "key": "<your Google API key>" } }, "pollInterval": 10000 }
note note NOTE In the above sample code, pollInterval defines the frequency at which the values are refreshed (in ms). Replace the code with your <Sheet ID> and <API Key>, that you fetched while setting up the Google Sheets. note caution CAUTION If you create your Google Sheets store configurations outside of the global folder (for instance in your own project folder), then targeting will not work out of the box.
-
-
Setting up Store Segmentation
-
Navigate to ContentHub Store Configuration… and create another store configuration in the screens configuration container and set the Title as segmentation-contexthub, Store Name as segmentation and Store Type as aem.segmentation.
-
Click Next and then Save.
note note NOTE You have to skip the process of defining the json and leave it as blank.
-
Step 3: Setting Up Segments in Audience setting-up-audience
-
Creating Segments in Audiences
-
Navigate from your AEM instance to Personalization > Audiences > screens.
-
Click Create > Create Context Hub Segment. The New ContextHub Segment dialog box opens.
-
Enter the Title as Higherthan50 and click Create. Similarly, create another segment titled as Lowerthan50.
-
Select the segment Higherthan50 and click Properties from the action bar.
-
Select the Personalization tab from the Segment Properties. Set the ContextHub Path to
/conf/screens/settings/cloudsettings/ContextHubDemo/contexthub configurations
and Segments Path to/conf/screens/settings/wcm/segments
and click Save, as shown in the figure below. -
Similarly, set the ContextHub Path and Segments Path for Lowerthan50 segment too.
-
Step 4: Setting Up Brand and Area setting-brand-area
Follow the steps below to create a brand in your activities and area under the brand:
-
Creating a Brand in Activities
-
Navigate from your AEM instance to Personalization > Activities.
-
Click Create > Create Brand.
-
Select Brand from the Create Page wizard and click Next.
-
Enter the Title as ScreensBrand and click Create. Your brand is now created as shown below.
note caution CAUTION Known Issue:
To add an area, remove the master from the URL, such ashttp://localhost:4502/libs/cq/personalization/touch-ui/content/v2/activities.html/content/campaigns/screensbrand/master
.
-
-
Creating an Area in your Brand
Follow the steps below to create an area in the brand:
-
Click Create and then Create Area.
-
Select Area from the Create Page wizard and click Next.
-
Enter the Title as ScreensValue and click Create.
An area will be created in your brand.
-
Step 5: Creating the Segments in an Activity step-setting-up-audience-segmentation
Once you have set up a data store and defined your activity (brand and area), follow steps below to create segments in your activity.
-
Creating Segments in Activities
-
Navigate from your AEM instance to Personalization > Activities > ScreensBrand >ScreensValue.
-
Click Create > Create Activity. The Configure Activity Wizard opens.
-
Enter the Title as ValueCheck50 and Name as valuecheck50. Select the Targeting engine as ContextHub (AEM) from the drop-down and click Next.
-
Click Add Experience from the Configure Activity Wizard.
-
From the Audiences, select the Higherthan50 and click Add Experience and enter the Title as higherthan50 Name as higherthan50. Click Ok.
-
From the Audiences, select the Lowerthan50 and click Add Experience and enter the Title as lowerthan50 Name as lowerthan50. Click Ok.
-
Click Next and then Save. ValueCheck50 activity is now created and configured.
-
Step 5: Editing the Segments in Audiences editing-audience-segmentation
-
Editing the Segments
-
Navigate from your AEM instance to Personalization > Audiences > screens.
-
Select the segment Higherthan50, and click Edit from the action bar.
-
Drag and drop the Comparison: Property - Value component to the editor.
-
Click the wrench icon to open the Comparing a property with value dialog box.
-
Select googlesheets/value/1/0 from the drop-down in Property name.
note note NOTE The googlesheets/value/1/0 refers to row 2 and column as populated in the google sheets in the figure below: -
Select the Operator as greater-than from the drop-down menu.
-
Enter the Value as 70.
note note NOTE The AEM validates your data from the Google Sheet by showing your segment as green.
Similarly, edit the property values to Lowerthan50.
-
Drag and drop the Comparison: Property - Value component to the editor.
-
Click the wrench icon to open the Comparing a property with value dialog box.
-
Select googlesheets/value/1/0 from the drop-down in Property name.
-
Select the Operator as less-than from the drop-down menu.
-
Enter the Value as 50.
-
Enabling Targeting in Channels step-enabling-targeting-in-channels
Follow the steps below to enable targeting in your channels.
-
Navigate to one of the AEM Screens channel. The following steps demonstrate how to enable targeting by using DataDrivenChannel created in an AEM Screens Channel.
-
Select the channel TargetChannel and click Properties from the action bar.
-
Select the Personalization tab to setup the ContextHub configurations.
-
Set the ContextHub Path to
/conf/screens/settings/wcm/segments
and Segments Path to/conf/screens/settings/wcm/segments
. -
Set brand to ScreensBrand from the dropdown and Set Area Reference to ScreensValue.
-
Click Save & Close.
note note NOTE Use the ContextHub and the Segments path, where you initially saved your context hub configurations and segments. -
Navigate and select the TargetChannel channel and click Edit from the action bar.
note note NOTE If you have set up everything correctly, you will see Targeting option in the drop-down from the editor, as shown in the figure below.
-
Learn More: Example Use Cases learn-more-example-use-cases
After you have configured ContextHub for your AEM Screens project, you can follow the different Use Cases to understand how data triggered assets plays a vital role in different industries: