Tutorial · Step 18 of 20

Paste the widget snippet

The snippet carries your project UID and no secret. It is the last step of the tour: after it, a visitor to your site can open the bubble and ask the questions your corpus answers.

Before you start

  • An external project with indexed documents. An internal project never serves a widget, and the page says so instead of showing a snippet.
  • Access to your site's template, or to the place its platform lets you add a script tag. The tag must be on every page where the bubble should appear.
  • The site's domain ready to be allow-listed. An empty allow-list authorises nothing, so the widget stays invisible until the domain is declared on the project.

Paste the widget snippet

Open the Widget page. The right column shows a live preview of the bubble; the left column holds the Design and Behavior tabs where you pick a template and set the colours.

The snippet is not on screen by default. Click Integration code in the toolbar above the preview — next to the Widget / Bubble toggle — and the panel opens in place of the preview. Then click Copy code at the top right of that panel. Click Preview to bring the bubble back.

Paste the tag into your site before the closing </body>, or into the script field your platform provides. One tag is enough: there is no iframe to size and no second script to add.

index.html
1<script
2 async
3 src="https://widget.querymindx.tech/widget/roomy-widget-conversational.js?v=<version>"
4 data-website-id="XXXX-XXXX-XXXX-XXXX-XXXX"
5></script>

The dashboard template decides the file name: roomy-widget-conversational.js or roomy-widget-minimalist.js. Copy the tag rather than retyping it, so the version suffix matches what is served.

The Integration code panel: the snippet and its copy button, opened from the toolbar above the preview. Open this page

What you see

The Integration code panel replaces the preview in the right column. It holds a dark code block with the tag, a Copy code button at its top right, and a comment line above the tag. The table names what the tag carries.

NameTypeDefaultDescription
src*urlThe template file, served from the widget host, with a version suffix the dashboard fills in. It changes per release, so copy the tag rather than retyping it.
data-website-id*stringThe project UID. It is what identifies the corpus the widget answers from. Without it the tag loads and does nothing.
data-project-namestringAdded only when the project has a name. Shown in the bubble until the stored configuration loads.
data-project-colorhex colourAdded only when a primary colour is set. Applied before the configuration loads, to avoid a flash of the default colour.
There is no key attribute, on purpose
A key pasted into a public page is readable by every visitor. The widget identifies itself by project UID, and the backend decides what that UID may read. Do not add an ak_ key to the tag: it would leak the credential that step 17 asked you to store.

What you see when it worked

  1. The button label switches to Copied! for about two seconds, then returns to Copy code.
  2. Pasting into your editor yields one tag, with the project UID in data-website-id.
  3. On the published site, the bubble appears in the corner chosen in the Design tab, with your colours.
  4. Changing a colour or the welcome message in the dashboard changes the live widget on its next load, with no edit to the snippet.

If it does not work

NameTypeDefaultDescription
The widget is not available for an internal projectinternal projectThe selected project is marked internal, so the page shows this message instead of a snippet. Switch to an external project: an internal corpus is never published.
The bubble does not appearuid or allow-listAn unknown UID fails silently, and an empty allowed-domains list fails the same way. Check the UID against the project row, then declare the site domain on the project.
The widget answers about the wrong projectmismatchThe UID in the pasted tag and the project edited in the dashboard are two different projects. Re-copy the snippet from the right project rather than editing the UID by hand.
The panel is cut off on mobilecss overflowA parent element with overflow hidden and a fixed height clips the bubble. Either let the bubble float, or mount it inline with data-contained inside a container you size yourself.

Next

That is the end of the tour. The widget is installed and the corpus behind it is the one you indexed. The reference page covers the parts this step only touched: per-platform installation, the domain allow-list, and what the widget may read: Website Widget