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.
How it works
Section titled “How it works”- The main channel’s widget is installed on the site.
- Additional channels are created for different scenarios.
- Each channel is assigned a routing code.
- The site passes the routing code when launching the widget via
vivo_api.setRegion(). - VivoChat directs conversations to the corresponding channel.
If the routing code is not passed or not found, conversations will go to the main channel.
Setting up routing
Section titled “Setting up routing”1. Create the main channel
Section titled “1. Create the main channel”Example:
mysiteThis channel will be used as the parent. Only itsWidget IDis installed on the site. How to obtain theWidget IDis described in the “Widget installation” section.
2. Create additional channels
Section titled “2. Create additional channels”Create separate channels for routing conversations.
For example:
mysite-enmysite-esmysite-de
3. Open the routing settings
Section titled “3. Open the routing settings”Go to the section:
Management → Communication channels → [main channel] → Regions
4. Add channels and specify routing codes
Section titled “4. Add channels and specify routing codes”For each channel:
- select the channel;
- specify the routing code.
For example:
| Code | Channel |
|---|---|
en |
mysite-en |
es |
mysite-es |
de |
mysite-de |
5. Pass the routing code to the widget
Section titled “5. Pass the routing code to the widget”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.
Routing codes
Section titled “Routing codes”The routing code is set manually when configuring the channel.
You can use any values:
enesdepartnervipmobile
Main condition
Section titled “Main condition”The value in setRegion() must exactly match the code specified in the routing settings.
Important
Section titled “Important”setRegion()must be called beforerun().- The
Widget IDremains 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()andrun()again. - The active chat is searched across all routing channels at once. Duplicate chats are not created.