logApplicationEvents()

This method logs all custom application events in the Hurree platform, which is then used to produce analytics.

To add the method

  1. Open your project.
  2. You can add this method anywhere, but we recommend that you open the controllers.js file in the js folder. controllers.js
  3. Add the method code wherever you wish to record an application event:
window.plugins.hurreSDK.logApplicationEvents(
    successCallback,
    errorCallback,
    {Event_Payload}
)

Arguments

These are the arguments for the method.

  1. successCallback - The Success Callback function is called following a successful log, and includes a success message
  2. errorCallback - The Error Callback function is called in case of an error, and includes an error message
  3. Event_Payload - The JSON Object's keys are listed below

Object Keys

Key Type Mandatory Description
log String Mandatory This indicates whether a log has been successful.
eventName String Mandatory This it the event's name.
eventType String Mandatory This it the event's type.

Sample Code

window.plugins.hurreSDK.logApplicationEvents(
    function(data){
        //success callback function
    },
    function(err){
        //error callback function
    },
    {
        log: "Added product to basket",
        eventName: "product details screen",
        eventType: "general"
    }
);

results matching ""

    No results matching ""