Overview
The monitoring module in eWizard.js framework provides the API methods for collecting KPIs from the Vue instances (slides and subslides). Use the monitoring API methods on the slides where you want to collect KPIs. The monitoring API is bound to the instance of Vue as $monitoring.
Custom monitoring API
Custom monitoring API is implemented as a custom Vue plugin. It's available via the $monitoring object on any Vue instance. You can call the custom monitoring API methods using this context on any slide or subslide.
this.$monitoring
Custom Monitoring Plugin provides the following API methods:
β’ submit
β’ submitOnLeave
submit
this.$monitoring.submit(key, value, options)
The submit method submits the KPIs selected on a slide. It returns the key-value pair.
The submit method can have the following parameters.
Parameter | Type | Description |
| string | The required KPI name. |
| boolean, number, string | The required KPI value. |
| any | The optional data describing KPIs. |
this.$monitoring.submit('slider', slider.value, { label: 'My slider value' });submitOnLeave
this.$monitoring.submitOnLeave(key, getData)
The submitOnLeave method returns the KPIs when you leave the current slide in your e-Detailer: navigate to the next or previous slide, close the slide.
The submitOnLeave method can have the following parameters.
Parameter | Type | Description |
| string | The required KPI name. |
| function | The function returning the object with the |
this.$monitoring.submitOnLeave('slider', () => {
return {
value: slider.value,
options: {
label: 'My slider value',
},
}
});Monitoring API for external systems
The eWizard.js framework collects KPIs on the e-Detailer slides for monitoring from external systems such as Remote Calls, Previewer, etc. The developers of these CLMs can call the monitoring API methods using the following context.
window.ewizardjs.monitoring
getKPI
window.ewizardjs.monitoring.getKPI()
The getKPI method returns the string of values for both the standard and custom monitoring: the time spent on a slide, the values selected.
clearStorage
window.ewizardjs.monitoring.clearStorage()
The clearStorage method clears all the monitoring values from the Session Storage in a browser.
suspend
window.ewizardjs.monitoring.suspend()
The suspend method stops the time tracker on the slide where you call this method. The monitoring stops collecting KPIs on the slide. To resume the KPIs collection, use the proceed method.
proceed
window.ewizardjs.monitoring.proceed()
The proceed method resumes the KPIs collection on a slide: starts the time tracker and records the selected values. To stop monitoring, use the suspend method.
setCustomKPI
window.ewizardjs.monitoring.setCustomKPI()
Use the setCustomKPI method to define the custom KPI values. You can use the array of key-value pairs.
window.ewizardjs.monitoring.setCustomKPI({ key: 'testField', value: '11' },)For more information, see Monitoring.
