Skip to Content
GuidesDevelopersResources
Website and widget

Embed code and widget options

Everything the Botello script tag does, its attributes, allowed domains and what it stores in the visitor’s browser.

Plans
All plans
Roles
Owner, Admin, User
Channels
Website
In the admin
Chatbot › Configuration › Install

The Botello widget is a single <script> tag. It loads widget.js from Botello, reads your assistant’s configuration, then renders the bubble and the chat panel in an isolated frame (iframe). This page describes exactly what the script does, its attributes, and how it works with allowed domains. For step-by-step installation, see Install the chatbot on your website.

Best for

Developers embedding Botello in a custom site, a single-page application (React, Vue, Next.js) or a headless Shopify theme, or who need to document the script for a security or cookie audit.

Before you start

  • You have copied the code from Chatbot, Install tab (Copy code).
  • The Website URL and, if needed, the Allowed domains are filled in under the Security section of the same tab.

The tag

Embed code
<script src="https://admin.botello.ch/widget.js" data-project-id="YOUR-CHATBOT-ID"></script>

Place it before </body>, on every page where the assistant should appear. The script can also be loaded with defer or async: if it cannot identify itself as the current script, it finds its own tag by its src (widget.js) and its data-project-id attribute.

Attributes

Prop

Type

Use "auto" mode only with rate-based prices

Only enable data-currency-mode="auto" if your foreign prices are calculated from exchange rates in Shopify. If you set prices manually per market, rate-based conversion would show amounts that differ from those in the cart.

The script also recognizes data-mock-… attributes reserved for debugging by the Botello team. Do not use them in production.

What the script does, in order

  1. It reads data-project-id and immediately defines window.Botello.identify (see JavaScript API).
  2. It reads window.BotelloSettings.identityToken if present.
  3. It fetches the assistant’s status and appearance from Botello. If the assistant is disabled, it stops without rendering anything.
  4. It creates the bubble and the panel, then loads the chat in an iframe served by admin.botello.ch. The panel starts closed.
  5. It sends the current page (path and title) to the iframe via postMessage on every navigation, including in a single-page application (pushState, replaceState, popstate). This way the assistant knows which page the visitor is on.
  6. It forwards the visitor’s identity token if there is one, only to the iframe’s origin, never in a URL.

The widget picks its interface language in this order: the browser language, then the lang attribute of your <html> tag, then French.

Allowed domains

The widget is meant to run on your site. Allowed pages are:

  • the host of the Website URL;
  • the hosts listed in Allowed domains;
  • for each one, the version with or without www. and all its subdomains: example.ch allows shop.example.ch, but not fake-example.ch.

Botello has two checks on the page displaying the widget:

  • server side, based on the page’s origin: a page not on the list gets a 403 error with the code WIDGET_DOMAIN_NOT_ALLOWED;
  • browser side, through the frame-ancestors rule, which defines which pages may display the chat iframe. Botello’s own pages (admin.botello.ch, botello.ch, app.botello.ch) are always allowed.

Each check can run in report mode (the unlisted page is only logged and the widget is shown) or in block mode. Both are in report mode by default. A chatbot with neither a Website URL nor Allowed domains is never rejected by the server-side check. Fill in your domains at installation anyway, so you are ready if blocking is turned on.

Testing on a staging domain

Add your test domain (for example staging.example.ch or example-staging.netlify.app) to Allowed domains. A subdomain of your main site is already covered.

What the script stores in the browser

Useful for your cookie banner and your record of processing activities. All keys are on your domain, suffixed with the chatbot ID. The script sets no cookies.

StorageKeyContentLifetime
localStoragebotello_session_<id>ID of the current conversation, to resume it from page to pageUntil a new conversation
localStoragebotello_visitor_<id>Anonymous, random visitor ID, to count unique visitorsPermanent
localStoragebotello_leadgate_<id>1 if the visitor has already filled in the pre-chat formPermanent
sessionStoragebotello-panel-size-<id>Panel size chosen by the visitor (desktop)Tab
sessionStoragebotello-invite-dismissed-<id>1 if the visitor closed the invitation next to the bubbleTab

If the browser blocks storage (strict private browsing, the Instagram or Facebook in-app browser), the widget still works: the visitor simply starts a fresh conversation.

The chat itself, inside the iframe served by admin.botello.ch, also keeps a few values in that origin’s localStorage (so third-party storage, from your site’s point of view): the conversation ID and visitor ID (botello_session_<id>, botello_visitor_<id>), the botello_leadgate_<id> flag, the state of submitted contact requests and their draft (botello_handoff_done_…, botello_handoff_draft_…), the contact cards shown (botello_contact_cards_…), the translated interface strings (botello_widget_strings_<language>) and the day’s exchange rates (botello-fx-rates-gbp). One sessionStorage key (botello_welcome_animated_…) prevents the welcome animation from replaying. The iframe sets no cookies. If the browser blocks third-party storage, these values are kept in memory for the lifetime of the page.

Examples

Troubleshooting

What you seeLikely causeFix
Console: “Botello Widget: Chatbot ID missing or invalid.”data-project-id missing or emptyCopy the code again from ChatbotConfigurationInstall
Console: “Botello Widget: Chatbot is inactive.”The assistant is disabledRe-enable it, or contact the Botello team
The bubble does not appear on a test domainThe domain is not allowedAdd it to Allowed domains
Two bubbles appearThe script is included twice (theme and plugin)Keep a single tag
Prices are in the wrong currency (Shopify)No market price for that currencyCreate market prices in Shopify, or use data-currency-mode="auto" if your prices are rate-based
The assistant does not know which page the visitor is onNavigation through a router that does not use the History APIReport it to support@botello.ch

Frequently asked questions

Learn more

Was this page helpful?
Checked against the product on 14 November 2026 Suggest a fix

On this page