UBM - Insights
Analytics
setUserRole :method
This method allows you to define a user role that can be used as a dimension in Analytics.
The user role is saved only when the Custom Analytics feature is active at the application level and user role recording is enabled.
Method Signature
setUserRole(configuration);Arguments
The configuration object supports the following property:
| Property | Type | Description | Required |
|---|---|---|---|
userRole | string | Specifies the user's role to be evaluated in Analytics. | Yes |
Code Sample
var configuration = {userRole: "Administrator"};
window.appnaviApi.analytics.setUserRole(configuration);
console.log("User role set as", configuration.userRole);ubmConfiguration :method
This method allows you to configure User Behavior Monitoring (UBM) settings for your application.
It accepts a configuration object that specifies whether UBM event capturing should be enabled or disabled.
Method Signature
ubmConfiguration(configuration);Arguments
The configuration object supports the following property:
| Property | Type | Description | Required |
|---|---|---|---|
captureEvents | boolean | Specifies whether UBM event capturing should be enabled for the application. | No |
Code Sample
var configuration = {captureEvents: true};
window.appnaviApi.analytics.ubmConfiguration(configuration);
console.log("Capture events set as", configuration.captureEvents);UBM Push Event API
The UBM Push Event API allows users to send customized events to User Behavior Monitoring (UBM).
Certain elements may not be recorded during mining because of their customized nature. The Push Event API can be used to send these events to UBM manually.
Multiple UBM events can be sent in a single request using the events array.
For more details, see the UBM Push Event API documentation.
Event Object
[ubmEvent]The event object supports the following properties:
| Property | Type | Description | Required |
|---|---|---|---|
eventType | string | Specifies the type of event. Supported values are RIGHT_CLICK, LEFT_CLICK, and PAGE_LOAD. | Yes |
areaLabel | string | Specifies custom text used as the area label. | No |
elementLabel | string | Specifies custom text used as the element label. | No |
tagType | string | Specifies the category or type of tag associated with the event. | Yes |
Code Sample
let ubmEvent = {
eventType: "RIGHT_CLICK",
areaLabel: "This is area",
elementLabel: "This is element label",
tagType: window.appnaviApi.tagType.button
};
window.appnaviApi.analytics.pushEvent({
type: "ubm",
events: [ubmEvent]
});setCustomFieldValue :method
This method allows you to add additional information to User Behavior Monitoring (UBM) events within your application.
The custom field values can be used for purposes such as data export and analysis based on the provided information.
Method Signature
setCustomFieldValue(configuration);Arguments
The configuration object supports the following properties.
Each custom field value must not exceed 32 characters. If a value exceeds 32 characters, it is truncated to 32 characters.
| Property | Type | Description | Required |
|---|---|---|---|
customField_1 | string | Specifies additional information to include with the UBM event. | No |
customField_2 | string | Specifies additional information to include with the UBM event. | No |
customField_3 | string | Specifies additional information to include with the UBM event. | No |
Code Sample
var configuration = {
customField_1: "Engineer",
customField_2: "19c19162-c760-47be-a6b9-cae88e562f2d"
};
window.appnaviApi.analytics.setCustomFieldValue(configuration);
console.log("UBM custom fields set as", configuration);Custom Push Event API
The Custom Push Event API allows users to send customized events based on their application's requirements.
Before using this API, the required custom event configuration must be created in the AppNavi Portal.
For more details, see the Custom Push Event API documentation.
Configuration Object
The configuration object supports the following properties:
| Property | Type | Description | Required |
|---|---|---|---|
eventType | string | Specifies the type of event. Custom events must use the CUSTOM: prefix. | Yes |
pageUrl | string | Specifies the URL of the page where the event occurs. | No |
pageTitle | string | Specifies the title of the page where the event occurs. | No |
customField_1 | string | Specifies a user-defined custom field for additional data. | No |
customField_2 | string | Specifies a user-defined custom field for additional data. | No |
customField_3 | string | Specifies a user-defined custom field for additional data. | No |
Code Sample
let ubmEvent = {
eventType: "CUSTOM:BUTTON_CLICK",
pageUrl: "https://example.com/dashboard",
pageTitle: "Dashboard",
customField_1: "User clicked on the submit button",
customField_2: "Button color: Blue",
customField_3: "Time spent on page: 5 minutes"
};
window.appnaviApi.analytics.pushEvent({
type: "ubm",
events: [ubmEvent]
});Updated 21 days ago