SalesIQ Scripts Bot Handlers
In the SalesIQ scripts bot builder, there are four handlers where you will begin to code called, trigger, message, context, and failure handler. This flow chart demonstrates how the SalesIQ Script works:
The flow of these handlers
- A visitor lands on the website. When this visitor matches the trigger criteria set while setting up the Zobot, the bot triggers a message (trigger handler executes).
- When the visitor doesn't match the triggers set and when they proceed to initiate a chat reactively with the Zobot, the message handler executes.
- It checks if the context in the message exists and if it does, it collects all the inputs that it can find in the message. Otherwise, it looks for another message that matches the existing context.
- Once the message handler is successfully executed, it collects all the responses from the visitors and gives them to the context handler executes to perform the desired action.
Customize Bot using Handlers
These handlers in SalesIQ Scripts are used to customize your bots.
- Trigger Handler:
The trigger handler is a piece of SalesIQ script that is used to invoke a custom action/message by the bot when the visitors visit your site. Check the various attributes passed when this handler is triggered.
- Message Handler:
The Message Handler is invoked when the bot receives a message from the website visitor. The combination of messages received from the website visitor will be analyzed and stored in the code already, and the bot will respond to the visitors based on the question they receive, from the available answers. Learn more about the attributes passed from the bot to the message handler.
- Context Handler:
The Context Handler can be used when the visitor engages in a conversation with the bot. Context is a data definition that is used to collect multiple inputs to perform a single action. The conversation is mostly in a question-answer format. They can work in association with Message handlers and Trigger handlers i.e., the handlers can return a context instead of a message reply. So, all the inputs defined in the context will be collected and the context handler will be invoked. In that case, the context handler is a piece of SalesIQ script that is invoked after collecting all the inputs for a particular context. Here are the various attributes passed from a bot to a context handler.
- Failure Handler:
The Failure handler gets invoked when the actions returned in the other handlers fail to execute. For example, when the message handler returns an action to forward the chat to an operator, and if the operator is unavailable, the failure handler gets invoked.Check the various attributes passed from the bot to the failure handler