Rate this page:

Function for adding buttons to a web chat

In this example, you will create a function that adds buttons to a web chat and route channel messages to this function.

Important

The maximum number of buttons in a web chat is 13. Text is required for each button and must not be greater than 40 characters.

  1. Create a web chat channel as shown here.
  2. Go to Administration > Functions > Management.
  3. Click New function.
New function

In this example, you add the following buttons:

  • What day is it today? - returns the current date

  • Agent needed - places the message in a queue

  • End the conversation - ends the conversation

  1. Copy the following code and paste it into the function.
Web chat buttons function

Web chat buttons function

  1. Click Create.
Add function
  1. Go to Setup > Conversations > Channels and select the web chat channel you created.
  2. Select Functions in the Redirect channel messages field.
  3. From the drop-down list, select the function you added earlier.
Redirect chat messages to the function
  1. Click Save changes.

The three buttons will now display in response to a customer. If a customer selects the What day is it today? button - they will receive a response with the current date; if a customer clicks the Agent needed button - the bot will inform them that the chat will be transferred to an agent; if a customer selects End the conversation - the chat closes.

Buttons

The button options offered to the customer or the selected option then display in the History > Messaging history and Reporting > Live monitoring > Conversations sections.