Developers

Track

Usage

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.

Mandatory parameters

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

Optional parameters

This method has no optional parameters.

Response data format

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.

Example

The following example is set to track a custom Event:

chatbot.api.track('CustomEvent',{value:"CustomValue"})