The following data attributes are used in the examples below:
Example 1: CTA to assign to a bot
Adding the data-web1on1-bot attribute to any button will open the widget and start the Testdrive bot. It takes a bot ID, and assigns the conversation to the corresponding bot.
Example button:
Example 2: CTA to mention a bot
Some bots interpret bot commands, sent to the bot as a mention
type message. For example, the
ChatScript bot runs a scripted conversation ID if you provide it after the `start` command, like this:
Example buttons:
Example 3: Quick-start initial agent message
Using the data-web1on1-agent-name
and data-web1on1-agent-text
attributes
to immediately insert an initial agent/bot message when the button is clicked.
We instruct the Chatscript bot to start with the second message (the message ID ending with '2001'):
Example button:
Example 4: Start a bot when widget is activated
To start a bot when the visitor activates the widget, as well as through a CTA button, first implement the first Autostart example. This will trigger the bot when the widget is opened. For the CTA button we use the data-web1on1-open attribute to just open the widget.
Example button:
Example 5: Open widget on link click
This link will just open the widget and was created with the following code:data-web1on1-preventdefault="true"
is added to stop following the link