Skip to content
  • Light
  • Dark
  • Auto

Conversation routing

Routing lets you direct conversations from a single widget to different channels.

Use routing if your site has:

  • multiple languages;
  • different types of users;
  • multiple brands;
  • separate support or sales teams.
  1. The main channel’s widget is installed on the site.
  2. Additional channels are created for different scenarios.
  3. Each channel is assigned a routing code.
  4. The site passes the routing code when launching the widget via vivo_api.setRegion().
  5. VivoChat directs conversations to the corresponding channel.

If the routing code is not passed or not found, conversations will go to the main channel.

Example:

  • mysite This channel will be used as the parent. Only its Widget ID is installed on the site. How to obtain the Widget ID is described in the “Widget installation” section.

Create separate channels for routing conversations.

For example:

  • mysite-en
  • mysite-es
  • mysite-de

Go to the section: Management → Communication channels → [main channel] → Regions

For each channel:

  • select the channel;
  • specify the routing code.

For example:

Code Channel
en mysite-en
es mysite-es
de mysite-de

Before calling run(), specify the routing code via setRegion().

Example:

<script defer>
(() => {
const script = document.createElement("script");
script.async = true;
script.src = "//widget.vivochat.ai/script/widget/YOUR_WIDGET_ID"; // Replace with your Widget ID
script.onload = () => {
vivo_api.setRegion("en"); // Replace "en" with your routing code
vivo_api.run({ withIcon: true });
};
document.head.appendChild(script);
})();
</script>

In this example, conversations will be directed to the channel assigned the code en.

The routing code is set manually when configuring the channel.

You can use any values:

  • en
  • es
  • de
  • partner
  • vip
  • mobile

The value in setRegion() must exactly match the code specified in the routing settings.

  • setRegion() must be called before run().
  • The Widget ID remains shared across all routing channels.
  • You do not need to install separate widgets for additional channels.
  • If the site changes its language or mode without reloading the page, call setRegion() and run() again.
  • The active chat is searched across all routing channels at once. Duplicate chats are not created.