Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In the case of chatbots running on the WebMessenger platform, event events occurring before, during, and at the end of a chatbot conversation can be caught and used for various purposes. Such typical purposes among others are debugging or tracking.

...

A typical use case of event handling is to track user actions in external tracking systems, ; for example, in Google Analytics.

The code snippet below will record a “MessageSent” event action in Google Analytics whenever an enduser sends a message to the chatbot. :

// Google Analytics tracking of messages sent by endusers
JobPal.on('message:sent', function(message){
ga('send', 'event', 'Chatbot', 'MessageSent');
});

Where In this example, “Chatbot” is the event category, and “MessageSent” is the event action. Additionally you might add parameters for event label and event value. You can learn more about event measurement in Google Analytics here.

Please don’t forget to add this these lines before invoking the JobPal.init function!

The setup above would will allow you to compare behavioural differences (like conversion rates) in Google Analytics between endusers interacting with the chatbot, and endusers not using the chatbot.

...