Skip to main content

 –

Adding stream data aggregates in the Customer Profile Designer

Suggest edit Updated on October 4, 2021

You can associate customer records with aggregate stream data by using the Customer Profile Designer.

Starting in Pega Customer Decision Hub version 8.6, you can manage associated data in Customer Profile Designer. Customer Profile Designer 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 aggregation logic and source data. These aggregates can then be associated with the extended customer analytical record (xCAR) data through the new Customer Profile Designer landing page, and used as predictors in adaptive models or as conditional properties in engagement policies.

Customer Profile Designer is available in Pega Customer Decision Hub 8.6 as a fully working early preview version. The functionality will be further expanded in future releases.

Creating the data class for Customer Profile Designer summaries

To add a new association for an entity (for example, PurchaseData) to a customer context, first create the class and service integration for the data source that you want to aggregate.

  1. In Dev Studio, create a class for the source data that you want to use for the associated entity. For more information, see Organizing rules into classes.
    For the purposes of being the data class for your source data, your class should inherit from Data- and be defined as a concrete class. Your class key should the identifier value of the source data and your class should be saved to your Pega Customer Decision Hub implementation ruleset.Note: If the property you select to be your class key is not available, you may need to create the property in the Data- class.Tip: To avoid problems when creating data summaries, ensure that both the class name and ID properties are short.
  2. Define the properties of your source data in this class.
  3. Create a Data Set rule for the associated entity.
    1. In Dev Studio, click RecordsData ModelData Set.
    2. Click Create.
    3. Provide a Label, and then select the Stream data type.
    4. Enter the Applies to class of the source data class that you created in step 1.
    5. Select to save your data set into your Pega Customer Decision Hub implementation ruleset.
    6. Set the Partition key to be the same as your class key.
    7. Save and check in your changes.
    8. Optional: Create a data flow that starts from your source data set and ends in an abstract shape, and then define and add a data transform to help transform your data as needed.
  4. Create the service integration by doing the following steps:
    1. In Dev Studio, create an integration service class. For more information, see Organizing rules into classes.
      For the purposes of being an integration service class, your class should be defined as an abstract class and saved into your Pega Customer Decision Hub implementation ruleset, or your integration ruleset, if it is separate from the implementation ruleset.
    2. Create a Page property in your source data class.
    3. Create a service activity that saves into your source stream data set. For example: If your previous page property is defined as ClickStreamPage, and your source data set is defined as ClickStream, your service activity would be defined as in the following figure:
    4. Create a service package rule.
    5. Create a REST service.
      Define the Resource class of your integration class in the REST service, and set your service activity as the POST implementation activity. Configure your POST method to map to JSON based on the Page property in your integration class.

Defining the data source on the Profile Data Sources landing page

The Profile Data Sources landing page is used for managing the rules associated with your Customer Profile Designer aggregation. After creating the data class, use the Profile Data Sources page to define the aggregated data source.

  1. In the Pega Customer Decision Hub interaction portal, click DataProfile Data Sources.
  2. Select the data set that you want to associate with a customer context by clicking AddData set.
  3. In the Add data set window, select the data set that you created, and click Add.
  4. Create a summary to aggregate the events in the data set by performing the following steps:
    1. Click AddSummary.
    2. In the Create summary window, select the data set to aggregate, and then click Create.
      Note: You can create summaries for stream data sets with one key, or data flows with a stream source and an abstract destination. Stream data sets and data flows with more than one key are not visible in the Create summary window.
    Note: You can define a maximum of 3 summaries with 120 data aggregates each. Each aggregate must have a unique name.
    Tip: You can see all the aggregate logic on one screen by searching and opening your Summary rule. In this way, you can easily confirm that you have defined everything correctly.
What to do next: Tip: In addition to data sets, you can create associated data sources based on data flows or summaries. Follow the steps above and select Data flow or Summary as the associated data source.

Associating a data summary with a customer context

You can associate the summary that you created with a customer context by using the Customer Profile Designer landing page. This allows the back-end data flows to use your summary aggregates as part of the customer record for use in decisioning.

  1. Open the Customer Profile Designer by clicking DataProfile Designer.
  2. Click Edit.
  3. Next to the context with which you want to associate the data set, click Add associated dataData set and then select the data set from the list.
    Tip: A single data source can only be associated with a single customer context. You cannot associate the same data source with multiple contexts.
  4. Click Save.Result: The data set is now associated with the customer context. You can review the context in the Context Dictionary.

Testing the data aggregates

To test your summary and aggregates, use the integration service that you defined to send JSON-based POST method calls. Confirm that the values have been received by opening your source data set and running a Browse operation on it.

Tip: The end-point URL for the integration service can be found on Service rule. A sample JSON request can be found on the stream data set rule. To view an example of the payload, click Custom service. Complete the test by confirming that the values have been received by opening your source data set and running a Browse operation on it.
  1. Open the data set rule.
  2. Click ActionsRun.
  3. Select Browse, and then click Run.
  4. Confirm that your data is loaded into your summary by opening the real-time data flow that is responsible for managing the data load:
    1. In Dev Studio, click ConfigureDecisioningDecisionsData flowsReal-time processing.
    2. Find the data flow for Customer Profile Designer that lists the number of successfully processed records.
    3. Verify that the number matches the number of records that you sent in through the REST service.
  5. Confirm the aggregation by opening the summary data set and browsing the data:
    1. Open your summary data set.
      Tip: The summary data set should have the same name as the summary rule that you created in the Summaries tab of the Profile Data Sources landing page.
    2. Click ActionsRun.
    3. Select Browse, and then click Run.
Did you find this content helpful? YesNo

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us