Integration with the Customer Decision Hub - pegasystems/uplus-wss GitHub Wiki
The Uplus WSS application showcases how to integrate with the Customer Decision Hub platform to display real-time offers and send real-time streaming event to the system to track user interaction.
The CDH provides API endpoints to get the offers from realtime containers. To get more details on real-time containers, the following training and documents are recommended:
- https://academy.pega.com/topic/real-time-containers/v1
- https://community.pega.com/knowledgebase/articles/pega-customer-decision-hub-user-guide/85/triggering-real-time-container-container-rest-service
To configure the CDH, go to the settings page and select 'Customer Decision Hub'. Enter the URL and port of the CDH node.
Note: the port number is optional - If the Uplus app is running from a separate domain (like github), it is required to run the CDH with https and to have a valid certificate otherwise the browser security will prevent the cross-domain HTTP request. If you are using Pega 8.5 or higher, it is recommended to use the 'V3' API.
In the CDH node, make sure the web treatments are associated with the offers. Also make sure the placement type is configured to either Hero/Tile in the treatment.
Display real-time offers
Offers are shown in 4 different places inside the application:
- home page on desktop
- home page on mobile
- account page
- offer page
The home page on desktop supports one hero placement and several tile placement offers.
On mobile, the home page only supports one offer (tile)
Inside the account page, you can have one main offer
In the offer page (example of offer page), you can have several tile placement offers.
Each place has its own configuration settings where you can configure the following details when you provide the container name, the different placements that can be used and the action to perform when clicking on the offer.
If the placement comes back as empty for the offer, it will be automatically added to the page. If the placement property is not empty, it must matched the filter entered in the 'Placement' input field. For example, if you only want to show 2 offers of type Tile, you will need to enter the value 'Tile,Tile'
Only the home page on desktop supports the Hero placement.
The action dropdown supports the following options:
- Mashup => The offer will either open the clickThrough url inside an iframe using micro-sites (usually renders the offer as Pega Mashup) or using a Built-in offer - note that Microsites are now deprecated and it is recommended to configure the CDH using built-in offer (see chapter below)
- BuiltIn => The offer is using the built-in functionality inside Uplus - Only the Basic offer is used - To switch automatically between different types of template (Detailed vs Basic) - use the Mashup configuration and return the expected URL
- PopUp => The offer will be opened as a new browser tab using the clickThroughURL parameter
- TopURL => The offer will be opened in the same document using the clickThroughURL parameter
Using Enable Capture reponse
The new default RTC setting in CDH has changed in Pega 8.6 from ‘Capture on retrieval’ to ‘Capture by Channel’. This means, by default no impressions are stored, unless the U+ app calls the CaptureReponse endpoint. Depending on the RTC Setting, you will need to check the checkbox 'Enable Capture Response' in the Uplus app to send the capture. The capture will be sent when the offer is visible on the screen
Using RTS events
You can enable RTS events by checking the checkbox 'enable Reat-time data streaming There is no endpoint provided OTB in the Customer Decision Hub that supports these RTS events - you can add a REST endpoint called DigitalActivityStream under the PegaMKTContainer service package.
Currently only FS retail instance has these rules by default.
To tweak the functionality if you have your own endpoint, you can edit the JS file called 'realtimecontainer.js' present under the js folder and modify the function sendRTSEvent. This function will receive the customerID and the item object which has a category and a name.
Using ClickStream events
Customer Profile Designer is a new data management tool in Pega Customer Decision Hub. This feature allows users to define their customer profile data with aggregate properties and summaries and enables Pega Customer Decision Hub to handle real-time aggregation based on specified logic and a defined stream of source data.
For clickStream to work, Customer Profile Designer Accelerator component is a pre-requisite and can be installed on Pega Marketplace https://community.pega.com/marketplace/components/customer-profile-designer-accelerator
Click streams event requires the use of the 'V3' API and Pega CDH version 8.6 or higher. To enable click stream, check the checkbox 'Enable Click Stream'.
click streams provides the ability to send user’s navigation details to the clickstream service in CDH (XCAR Behavioral Data component) to showcase Customer Profile Designer and clickstream summaries.
2 types of events are being sent:
'Access' event
'PageView' event
Note: the following aggregators do not apply to UPlus
- Account Overview Page
- Help Page
- Branch Locator Page
- Churn Page
- Mortgage Page
- Interest Level
Important Note: The ClickStream endpoints have changed on September 2023 - Uplus v1 has been updated to use the new endpoint is 1.6.2 (https://github.com/pegasystems/uplus-wss/releases/tag/1.6.2) and the old endpoint is no longer supported - the new endpoint url is structured as https://xxxxxxxxxxxxxx/prweb/api/BehavioralData/01.01/Insert and the payload is the following:
{ "PageLocation" : "[www.pega.com](https://www.pega.com/)", "EventType" : "PageView", "DeviceType" : "PC", "EventTimestamp" : "20230504T064951.305 GMT", "PageViewActiveTime" : "60", "PageType" : "Card", "CustomerID" : "14", "CookieID" : "p-1" }
Using Built-in offers
Built-in offers is a new feature added to Uplus in Dec 2022 that allows to render an offer using the built-in UI - this new functionality is used to address the fact that micro-sites are now deprecated and we recommend the main web application that calls the Container API to actually render the offer using the meta data provided by the API
Uplus supports 2 types of offers:
- Built-in: The Basic offer is always returned - the clickThroughURL returned in the offer is not used
- Mashup: The clickThroughURL returned by the offer is used to determine what type of offer template should be presented
Important Note: using the Mashup option and the built-in offer requires to run the CDH AND the Uplus application on the same system
There are 2 types of templates:
- Basic - to load this offer, set the ClickThroughURL to starts with '/Basic'
- Detailed - to load this offer, set the ClickThroughURL to starts with '/Detailed'
If the Detailed offer is selected, some custom attributes can be passed and added to the template
The label of the custom attribute can be localized – like the ones shipped OOB. If the attribute is called ‘OfferValue’ – you need to create a property offer_builtin_OfferValue in the lang file to pick up the localized value – if the value is not present, the label of the attribute will be shown