Pega Systems
Overview
Pyze for Pega enables analytics tracking in both Traditional and Constellation Pega applications. Once installed, Pyze automatically captures user interactions and allows you to track custom events and user profiles.
Prerequisites: Create a Pyze app and obtain your App Key before proceeding.
Getting Started
Step 1: Download the Package
Download the latest Pyze component from the GitHub releases page.
Step 2: Import into Pega
- Open Dev Studio
- Navigate to Configure β Application β Distribution β Import
- Select the downloaded zip file and click Next
- Continue through the wizard until import completes
Step 3: Enable the Component
- Open Application Definition in Dev Studio
- Click Manage Components under Enabled Components
- Select Pega Pyze Component and click OK
Step 4: Configure Your App Key
- Open Data types from the left menu
- Click the dropdown arrow and select Add data type
- Choose Existing Data Type and search for “Pyze”
- Select AppKeysForPyze and click Submit
- Open the data type and go to the Records tab
- Add a record with your Application Name and Pyze App Key
Important
Use the App Key from your Pyze account. Using an incorrect key will prevent data from being collected.For Constellation applications: Continue to the next section to deploy the Pyze widget.
Constellation UI: Widget Deployment
Constellation applications require the Pyze widget to be manually added to pages where you want tracking enabled.
Add Widget to Home Page
- Open App Studio
- Go to Channels and interfaces β Landing Page β Portal
- Click pyHome
- Click +Add and select the Pyze widget
- Save changes
Add Widget to Case Types
Repeat for each case type you want to track:
- Open Dev Studio
- Go to Case Designer and select your case type
- Open the UX tab
- Click +Add and select the Pyze widget
- Save changes
Note
Analytics are only captured on pages where the widget is deployed. Add the widget to each case type individually.Verify Installation
Confirm the following:
- Pyze widget appears on the pyHome landing page
- Pyze widget appears on your case type screens
- App Key is correctly configured
- Data appears in your Pyze dashboard
User Profiles
Link events to specific users by setting a profile when they log in.
Identify a User
Call once when a user logs in:
PyzeIdentity.setUserProfile(
"user-123", // Unique user ID
{ // Pyze profile attributes
"email_id": "john@example.com",
"first_name": "John",
"last_name": "Smith"
},
{ // Custom attributes
"department": "Sales",
"region": "West"
}
);
Update Profile
Modify attributes for an already-identified user:
PyzeIdentity.updateUserProfile(
{ "email_id": "john.smith@example.com" },
{ "region": "East" }
);
Clear Profile on Logout
Reset identity when user logs out:
PyzeIdentity.resetUserProfile();
Supported Profile Fields
| Field | Format | Example |
|---|---|---|
email_id |
string | "user@example.com" |
first_name |
string | "John" |
last_name |
string | "Smith" |
date_of_birth |
YYYY-MM-DD | "1990-05-15" |
phone |
string | "+1-555-1234" |
gender |
M/F/O/N/P/U | "M" |
country |
ISO-3166-1 alpha-2 | "US" |
language |
ISO-639-1 | "en" |
home_city |
string | "San Francisco" |
time_zone |
IANA timezone | "America/Los_Angeles" |
User Privacy
Opt Out of Tracking
Allow users to stop data collection:
Pyze.setUserOptOut(true); // Stop collecting
Pyze.setUserOptOut(false); // Resume collecting
Delete User Data
Permanently remove all user data from Pyze:
Pyze.deleteUser(true);
Warning
This action is irreversible. All historical data for this user will be permanently deleted.Advanced Configuration
Tracking Clipboard Data
Capture additional case data from the Pega clipboard.
Step 1: Identify the attribute key in the clipboard (must be a simple type like String or Number).
Step 2: Configure tracking:
- Go to Dev Studio β Configure β User Interface β Web Analytics
- Click Settings β App Data tab
- Click Add Item
- Enter the attribute name and key in format:
pyWorkPage.ATTRIBUTE_NAME - Click Submit
- Open Data types in Dev Studio
- Search for ConfigPyze
- Go to the Records tab
- Add a record with the attribute name and key in format:
caseInfo.ATTRIBUTE_NAME
Data Hashing
If the Pyze agent has been configured to collect sensitive data (such as email addresses, user IDs, or other PII), consider hashing the data before it is sent to Pyze. See the Data Hashing documentation for details.
Access Control
Control which users have Pyze enabled.
| Mode | Setting | Result |
|---|---|---|
| All users (default) | EnablePyzeByRole = false |
Everyone has Pyze enabled |
| By access group | EnablePyzeByRole = true |
Only users with PyzePegaRole:EnablePyze role |
| Disabled | Uncheck “Use web analytics” | No one has Pyze enabled |
Enable for Specific Access Groups
- Go to Records β SysAdmin β Dynamic System Settings
- Set
EnablePyzeByRoletotrue
- Add role
PyzePegaRole:EnablePyzeto desired access groups
Disable Pyze Completely
- Go to Configure β User Interface β Web Analytics
- Uncheck Use web analytics
Uninstalling Pyze
To completely remove Pyze from your application:
- Remove component: Open Application Definition, click Manage Components, remove Pyze Component
- Remove roles: Delete
PyzePegaRole:EnablePyzefrom all access groups - Unlock ruleset: Unlock the Pyze component and ruleset for editing
- Delete ruleset: Go to System β Refactor β RuleSets, delete
PyzeIntegRS - Delete component: Remove the component record
- Re-login to complete removal
Warning
Always remove the role from access groups before deleting the component to avoid orphaned references.API Reference
See the full Web API Reference for all available methods.
| Method | Description |
|---|---|
PyzeEvents.postCustomEvent(name) |
Track a simple event |
PyzeEvents.postCustomEventWithAttributes(name, attrs) |
Track event with attributes |
PyzeEvents.startTimerForEvent(name) |
Start timing an event |
PyzeEvents.postTimedEvent(name) |
Post timed event |
PyzeIdentity.setUserProfile(id, pyzeAttrs, customAttrs) |
Identify a user |
PyzeIdentity.updateUserProfile(pyzeAttrs, customAttrs) |
Update user attributes |
PyzeIdentity.resetUserProfile() |
Clear user identity |
Pyze.setUserOptOut(boolean) |
Toggle data collection |
Pyze.deleteUser(boolean) |
Delete user data |