All standard and custom events such as "click", "Double Click", "Focus change", “switch”, “SeekBar” and etc can be tracked using the “trackCustom” method. Also, it can be used to track the views.
Method
trackCustom: function(params, successCallback, errorCallback)
Parameters
params - The json array object which contains the tracking information about the custom event.
The json array should includes the name of the event with key "eventName".
successCallback - Call back method in which the plugin returns the Success messages.
errorCallback - Call back method in which the plugin returns the Error messages.
Example
BUTTON CLICK
var trackOnClickEventJson = {eventName: "onClick", name: "Login Button", type: "Button", ... };
cordova.plugins.datagran.trackCustom(trackOnClickEventJson, success, failure);
KEYPRESS
var trackTrackViewJson = {eventName: "onKeyPress", value: "2", ... };
cordova.plugins.datagran.trackCustom(trackTrackViewJson, success, failure);
TEXT FOCUSCHANGE
var trackTrackViewJson = {eventName: "onFocusChange", value: "Username Text", ... };
cordova.plugins.datagran.trackCustom(trackTrackViewJson, success, failure);
VIEWS
var trackTrackViewJson = {eventName: "Views", viewName: "Login View", ... };
cordova.plugins.datagran.trackCustom(trackTrackViewJson, success, failure);