Use this method to track your own custom events. For more information about events and their specific data, see the tracking events section of the Developers Portal. Remember to set up a session by creating a conversation with the Chat app before calling this function.
Name | Object attribute | Type | Description |
---|---|---|---|
eventName | string | The name of the tracking event | |
data | object | The custom event data | |
value | string | The custom rating value |
This method has no optional parameters.
This method calls the Chat API’s POST /inbtrck/events
endpoint. It returns a Promise with the API response data. Please refer to the Responses section of the endpoint on the Chat API Routes page for the response format.
The following example is set to track a custom Event:
chatbot.api.track('CustomEvent',{value:"CustomValue"})