Custom HTML installation

A website assistant in one embed.

Drop the launcher into your shared layout or give the conversation its own space on a page. The generated embed contains your public assistant ID.

Two wooden arrows mark a fork in a walking trail beside an open map
Custom HTML index.html

Choose the embed that fits your layout

If you have a shared footer, install the launcher once. If the chat is part of a specific page, use the inline iframe there.

Documentation from MDN
  1. Copy the code for your assistant

    Open Install in the Botforger studio. The floating widget snippet includes widget.js and your assistant ID in the data-bot attribute.

  2. Place it in the page template

    Add the script before the closing body tag of your shared layout. For an inline conversation, paste the iframe from the studio into the page content instead.

  3. Check the published origin

    Open a public page in a fresh window. Test focus, opening and closing on a phone. If your site restricts scripts or frames, allow the Botforger embed origin in the appropriate site policy.

Embed code

Get your snippet.

Enter the public assistant ID from your studio to personalize this example. Your ready-made code is also available under Install in Botforger.

Floating widget
<script src="https://chats.botforger.com/widget.js"
  data-bot="YOUR_ASSISTANT_ID" async></script>

Place this script before the closing body tag of the website.

A trail guide before the signal drops

“Where can I download the map before we start walking?” Give your trail assistant the download link and the name of the first stop. Keep both visible on the starting page for walkers who already know what they need.

The Botforger robot studies three chat bubbles on a phone propped on a desk

Match the embed to the walk

An inline chat at the starting point
Place the iframe below the downloads on the trailhead page. Give it a descriptive title such as “Walking trail questions” so a screen reader can distinguish the chat from the interactive map.
A launcher at each numbered stop
Put the script in the shared trail layout if walkers arrive by scanning signs at different stops. A direct visit to stop seven then offers the same help as the trailhead.

Try a stop directly from its sign

Open a stop’s public address in a fresh tab. Test at phone width and check the map download.

MDN on sizing and labelling an iframe
Does the launcher work only on the homepage?
View the delivered HTML for a stop. If it lacks widget.js, add the snippet to the layout used to generate stop pages, rebuild the site and publish those pages.
Does the iframe open a sign-in page?
Check its src. Copy the inline iframe from Install so it includes the public /#/widget/ path and assistant ID. A studio editing address requires an owner account.
Is the conversation squeezed into a short strip?
Inspect the iframe height and its containing element. Restore the studio’s starting height of 560 pixels, let the frame fill the column width and check the message field on a phone.
FAQ

Frequently asked questions

Should my AI key appear in the embed code?

The public embed uses an assistant ID. Configure your provider key only inside your signed-in Botforger workspace.

Prepare the assistant for your own page template.

Build my chatbot