Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

Adding stream data aggregates in the Customer Profile Designer

Updated on May 30, 2022

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 decision management.

  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 summary, click Add associated dataSummary and then select the summary 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 summary 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.

Manually importing customer data

In addition to the automated data ingestion process, you can use the import mechanism on the Records tab of Customer Profile Designer to import multiple instances using a .csv file.

To initiate an import, click the Import link above the instances grid. Note: The Import link is disabled if a data import is already in progress for the data type.

At a high level, the import process has the following three steps:

  1. In the Pega Customer Decision Hub interaction portal, click DataProfile Designer.
  2. Click on the context where you want to import customer records, for example, Subscriber.
  3. Upload a .csv file and select one of the following import purposes:
    1. Add or update - Use this option to create new records for those instances in the import file that do not currently exist in the system, and to update records for those instances that do exist.
    2. Add only - Use this option to only create new records for those instances in the import file that do not currently exist in the system. Records for existing instances will not be updated.
    3. Delete - Use this option to delete matching records from the system.
  4. Click Map fields to select the field to use for matching records, and specify the mappings for all fields to import.
  5. Click Import records to start the import process.Result: When importing large files, the import progress can take some time. The system displays the status of the import at the top of the Data Management landing page. Once the import completes, the system displays the number of instances that were added or updated by the import. If there were errors during the import, the number of erroneous records is also shown.
  6. To download a .csv file containing the records which failed to import, click See more.
    The last column in this file contains a description of the error that occurred.
  7. Optional: Click the Export link above the list of imported records to export them to a .csv file.
  8. Optional: To manually add, update or remove records, perform one of the following actions:
    • Add an instance - To add an instance, click the Add record link at the bottom of the grid. Fill in all necessary fields and click anywhere outside the input row. To cancel your changes and discard the new record, click the delete icon at the end of the row.
    • Modify an instance - To modify an instance, click anywhere in the desired row. The row will toggle to editable mode. After making the desired changes, click anywhere outside the row to save the modified instance.

      Note: The key value of an instance cannot be modified.
    • Delete an instance - To delete an instance, click the delete icon at the end of the row.
    Note: Access to add, modify, or delete data instances is managed by standard Pega Platform security privileges. Administrators can use these privileges to grant or restrict access as needed.
  • Previous topic Adding associated static data in the Customer Profile Designer
  • Next topic Manually configuring the customer class

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us