Web1on1 Automotive Conversations

Dealer

Livechat Widget

Scripting

Messages, including commands and variables, can be sent to the backend when the widget is activated.

The following widget API functions are used in the example below:

  • setPredefinedMessage
  • api.showFakeAgentMessage
  • api.sendClientMessage
See the widget API documentation for more details, and more widget API methods.

Example 1: Pre-send messages when the widget is opened

On this page, when the widget is opened:

  • the input field is filled with a suggested message
  • a 'fake' agent welcome message is shown immediately
  • the conversation is assigned to a bot
  • the conversation category is set to 'Used Car'
  • the organization is notified through message routing

This is implemented as the following code:



Example 2: Process a form when the widget is opened

Messages sent from the widget support non-chat message types like forms, fields and commands. You can use sendClientMessage to fill in form fields and use the /send command to process the form into a result.

This can be implemented with the following code:



See the widget API documentation for more details.