Show Menu
TOPICS×

Configuring ContextHub in AEM Screens

This section emphasizes on creating and managing data driven asset changes using a a data store.

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

Before you start setting up a data store for configuring Context Hub Configurations for an AEM Screens project, you must set up Google Sheets (for demonstration purposes).
Google Sheets is used in the following example as a sample database system from where the values are fetched and is solely for educational purposes. Adobe does not endorse using Google Sheets for production environments.
For more information, refer to Get API Key in Google documentation.

Step 1: Setting up a Data Store

Follow the steps below to set up a data store that allows you to use ContextHub configurations and segments path to AEM Screens channel.
  1. 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.
  2. Creating a new ContextHub Store Configuration
    1. Navigate to global > default > ContextHub Configuration .
    2. Click** Create > Configuration Container and enter the title as ContextHubDemo**.
    3. Navigate to ContextHubDemo > ContentHub Store Configuration... to open the Configure wizard .
    4. Enter the Title as Google Sheets , Store Name as googlesheets , and Store Type as contexthub.generic-jsonp
    5. Click Next
    6. Enter your specific json configuration**.** For example, you can use the following json for demo purposes.
    7. Click Save .
    {
      "service": {
        "host": "sheets.googleapis.com",
        "port": 80,
        "path": "/v4/spreadsheets/<your sheet it>/values/Sheet1",
        "jsonp": false,
        "secure": true,
        "params": {
          "key": "<your API key>"
        }
      },
      "pollInterval": 3000
    }
    
    
    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.
    If you create your Google Sheets store configurations outside of the legacy folder (for instance in your own project folder), then targeting will not work out of the box.
    In case, you want to configure the Google Sheets store configurations outside the global legacy folder, then you should must set the Store Name as segmentation and Store Type as aem.segmentation . Additionally, you have to skip the process of defining the json as defined above.
  3. Creating a Brand in Activities
    1. Navigate from your AEM instance to Personalization > Activities
    2. Click Create > Create Brand
    3. Select Brand from the Create Page wizard and click Next
    4. Enter the Title as ContextHubDemo and click Create . Your brand is now created as shown below.
    Known Issue:
    To add an area, remove the master from the URL, such as
    https://localhost:4502/libs/cq/personalization/touch-ui/content/v2/activities.html/content/campaigns/contexthubdemo/master
  4. Creating an Area in your Brand
    Follow the steps below to create an area in the brand:
    1. Click Create and then Create Area
    2. Select Area from the Create Page wizard and click Next
    3. Enter the Title as GoogleSheets and click Create . Your area will be created in your activity.

Step 2: Setting Up Audience Segmentation

Once you have set up a data store and defined your brand, follow the steps below to set up audience segments.
  1. Creating Segments in Audiences
    1. Navigate from your AEM instance to Personalization > Audiences > We.Retail .
    2. Click Create > Create Context Hub Segment. The New ContextHub Segment dialog box opens.
    3. Enter the Title as SheetA1 1 and click Create . Similarly, create another segment titled as SheetA2 2 .
  2. Editing the Segments
    1. Select the segment Sheets A1 1 (created in step (5)), and click Edit from the action bar.
    2. Drag and drop the Comparison: Property - Value component to the editor.
    3. Click the wrench icon to open the Comparing a property with value dialog box.
    4. Select googlesheets/value/1/0 from the drop-down in Property name .
    5. Select the Operator as Equal from the drop-down menu.
    6. Enter the Value as 1 .
    The AEM validates your data from the Google Sheet by showing your segment as green.
    Similarly, edit the property values to Sheets A1 2 .
    1. Drag and drop the Comparison: Property - Value component to the editor.
    2. Click the wrench icon to open the Comparing a property with value dialog box.
    3. Select googlesheets/value/1/0 from the drop-down in Property name .
    4. Select the Operator as Equal from the drop-down menu.
    5. Enter the Value as 2 .
    The rules applied in the preceding steps are just an example as to how you set up segments for implementing the following use cases.

Step 3: Enabling Targeting in Channels

Follow the steps below to enable targeting in your channels.
  1. Navigate to one of the AEM Screens channel**. **The following steps demonstrate how to enable targeting by using DataDrivenRetail created in an AEM Screens Channel.
  2. Select the channel DataDrivenRetail and click Properties from the action bar.
  3. Select the Personalization tab to setup the ContextHub configurations.
    1. Select the ContextHub Path as libs > settings > cloudsettings > default > ContextHub Configurations and click Select .
    2. Select the Segments Path as conf > We.Retail > settings > wcm > segments and click Select .
    3. Click Save & Close .
    Use the ContextHub and the Segments path, where you initially saved your context hub configurations and segments.
  4. Navigate and select the DataDrivenRetail from DataDrivenAssets > Channels and click Edit from the action bar.
    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.
    Once you have configured the ContextHub configurations for your channel, make sure you follow preceding steps from 1 through 4, for the other three sequence channels too if you want to follow all the use cases below.

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: