When the JS SDK is initialized, it automatically collects various standard metrics from a client and the standard metrics will be accessible using the Standard Reports within Kony Fabric Console.
The JS SDK also provides the ability for a developer to send additional custom metrics from a client app to Kony Fabric back-end to capture additional information. These custom data sets will be accessible using the Custom Reporting feature within Kony Fabric Console where a business analyst can design and share reports using a combination of standard and custom metrics.
Additionally, the JS SDK provides an Events API that allows an app to track user actions within the app to gain insight into the user journey. The developer can send various standard events such as form entry, touch events, service requests, gestures and errors. The developer can also send custom events to capture any app specific scenarios or transactions. These events can be analyzed within Kony Fabric Console by using the Standard Reports or user defined Custom Reports. For more details, refer to Custom Metrics and Reports Guide.
This section lists all MetricsService
object APIs.
The MetricsService class sets the configuration for APM event reporting.
//Sample code to create an instance of setEventConfig with variable name "setEventConfig" var metricsServiceObj = servicesObj.getMetricsService() metricsServiceObj.setEventConfig("Instant", 50, 200);
The setUserID API sets the user ID for the data gathered from an application. The user ID allows the data to be tracked on a user basis for broad analysis like how many different users used the application. It also helps to track activities of a specific user, which can help in seeing what activities were done before a crash, or what events led to a transaction not passing through. The user ID allows the same user to be tracked across different devices as well.
//Sample code to set up the user ID of application uservar metrics
ServiceObj = servicesObj.getMetricsService() metricsServiceObj.setUserID("myUserID");
Note: The UserId related to metrics. The UserId length cannot be more than 100 characters.
The sendEvent API allows a developer to send event details from an application to server for analytics and reporting purposes. The event data is added to a buffer and sent to server as per configuration values set by the developer using setEventConfig API.
//Sample code to send reports var metrics
ServiceObj = servicesObj.getMetricsService() metricsServiceObj.sendEvent("FormEntry", "frmHome", "frmHome", null, { "key1": "value1" });
The setFlowTag API sets an event flow tag to be associated with all new events that are reported by using thesendEvent API. The flow tag is used to ease searching event data in terms of application flows like loginflow, searchflow. The setFlowTag also helps sorting and filtering data while building custom reports or running standard reports for the application events.
//Sample code to setFlowTagmetrics
ServiceObj.setFlowTag("Myflowtag")
The clearFlowTag API clears the currently set event flow tag.
//Sample code to clearFlowTag var metricsServiceObj = servicesObj.getMetricsService() metricsServiceObj.clearFlowTag();
The getFlowTag API gets the currently set event flow tag.
//Sample code to getFlowTag var metricsServiceObj = servicesObj.getMetricsService() var flowtag = metricsServiceObj.getFlowTag();
The reportError API enables an app to report an error event to metrics server.
//Sample code to reportError var metricsServiceObj = servicesObj.getMetricsService() metricsServiceObj.reportError("1234", "SpecificError", "custom error message", "{errfile:file.js}");
The reportHandledException API enables apps to report a handled exception event.
//Sample code to send exception to metrics server var metricsServiceObj = servicesObj.getMetricsService() metricsServiceObj.reportHandledException("1234", "SpecificException", "custom exception message", "{errfile:file.js}");
The flushEvents API allows a developer to force events to be sent to the server. The entire current event buffer is loaded and sent to the server for processing.The flushEvents API is used as an override to send event data to server before the configured value or a service call that flushes the buffer.
//Sample code to flushEvents var metricsServiceObj = servicesObj.getMetricsService() metricsServiceObj.flushEvents();
The sendCustomMetrics API sends custom metrics event.
//Sample code to sendCustomMetrics var metricsServiceObj = servicesObj.getMetricsService() metricsServiceObj.sendCustomMetrics("formID", { "metric": "metricdata" });
For more details about custom metrics and reports, refer to Custom Metrics and Reports Guide.
For all event details, ts and SID values are automatically filled by MBaaS Client SDK, as part of the reportEvent, reportError and reportHandledException API calls. In case of automatically captured events, flowTag is also automatically filled with the currently set flowTag. Following are event specific details to be used while interfacing with MBaaS SDK.
GESTURETYPE_NUMBEROFINPUTS_DIRECTION
Copyright © 2020 Kony, Inc. All rights reserved. |