In this quick tutorial, Gordy shows you how to make your bot talk first in a conversation with no code required!
The new āConversation Startā trigger makes it easy to get your bot to start the conversation first. Before we get to the trigger, letās quickly review what all happens when a user visits a website and starts a conversation with a bot:
1. The website starts loading
2. The website finishes loading
3. The user clicks on the bot icon
4. The bot web widget shows itself
5. A new conversation is created with a unique ID
6. The bot web widget is ready for a chat
7. The user (or the bot) says something
Each of these is called an
event. Triggers let us tell the bot to do something every time an event occurs. In this example, weāll be using event 5 from this list.
>
First, make the trigger
You can create a trigger either by clicking and dragging the āconversation startā card from the side panel, or by right clicking, selecting ātriggerā and then selecting āconversation startā from the inspector panel.
Connect this trigger to where you want your bot to flow. This is
not the start node, but the node
after the start node.
Finally, publish your bot.
>
Embed the bot in a website
The āconversation startā trigger only works when the bot is embedded in a website. The easiest way to embed your bot into a webpage is with the āpreconfiguredā embedding code in the webchat integration.
You can copy and paste these lines of code into your websiteās HTML. Here is the example I used in the video:
https://jsfiddle.net/GordyNumberOne/tc4naqkm/
The bot embedding script is on lines 108 and 109.
Finally, reload your bot and start a chat. After a brief delay, your bot should speak first!