Web widget
The web widget puts a chat bubble on your site. Visitors talk to the same agent that serves your other channels, and the conversations reach Manoflow.
Get the code
Section titled “Get the code”- In Manoflow, go to Settings > Channels > Web widget.
- Create a widget, choose the agent and set the look (color, name, welcome message…). The preview shows how it will look.
- Click Publish.
- Under Code for your site, click Copy code.
The code is a single line of this shape:
<script src="https://<widget address>/widget/v1/widget.js" data-widget-key="<widget key>" async></script>Always copy the line Manoflow gives you: do not build the address by hand.
Paste it into your site
Section titled “Paste it into your site”Paste the line into the HTML of every page where you want the chat, preferably before </body>. Nothing else is needed:
- The line does not change when you publish changes. A look change shows on pages loaded about a minute later.
- If you turn the widget off in Manoflow, the bubble stops showing on new page loads within a minute at most.
- It works on any domain and in an app’s webview. There are no domains to register.
- Load the script as a classic script, not with
type="module".
If your site uses a Content-Security-Policy
Section titled “If your site uses a Content-Security-Policy”If your site sets a Content-Security-Policy (CSP), allow the origin of the widget address (the https://<widget address> part of the line). Manoflow shows the exact values under the code.
| Directive | Value |
|---|---|
script-src |
the widget origin |
connect-src |
the widget origin |
img-src |
https: |
media-src |
https: |
Nothing is needed in style-src or font-src.
Optional attributes
Section titled “Optional attributes”The usual way is to set the look in Manoflow. If you prefer to pin a value on a page, add a data-* attribute to the line; the attribute takes precedence over what is published in Manoflow.
| Attribute | Value |
|---|---|
data-lang |
es or en. Without it, the published language or the page’s lang is used |
data-accent |
Color as #rrggbb |
data-name |
Name in the chat header, up to 60 characters |
data-subtitle |
A second line under the name, up to 60 characters |
data-avatar |
https URL of an image for the header and the bot’s messages |
data-theme |
light, dark or auto (follows the device’s mode) |
data-launcher |
Button icon: chat, message or help |
data-position |
right or left |
data-welcome |
Welcome message, up to 500 characters |
data-placeholder |
Text of the input box, up to 80 characters |
data-privacy-url |
https URL of the “Privacy” link |
data-contact-url |
https URL of the “Contact” link |
For example, for an English version of your site:
<script src="https://<widget address>/widget/v1/widget.js" data-widget-key="<widget key>" data-lang="en" async></script>Good to know
Section titled “Good to know”- The widget keeps the visitor’s session in your site’s
localStorage, so a reload continues the same conversation. - Each message sends the page’s address (origin and path, without query or
#). Keep this in mind if your site’s paths contain personal data. - Minimum browsers: Chrome 73, Firefox 101 and Safari 16.4. On older browsers the widget does not show.
- If you embed the widget in an app, test it in the iOS and Android webviews before releasing the app.