Chat puts a chat window on your website. Visitors ask questions, and an AI assistant answers using the knowledge sources you choose, such as your website content or your knowledge base. Every conversation is saved so your team can follow up. This article covers setting up widgets under **Grow → Chat → Widgets**. To follow up on chats, see [Chat conversations](/grow/chat-conversations).

## Before you start

- Your package must include Website Chat. Automatic AI answers also need the Chat AI feature. Without it, visitors can still chat, but only your team replies. See [Package and add-ons](/account-and-access/package-and-add-ons).
- You need permission to view and edit widgets, and separate permission to view conversations. See [Users, teams, groups and permissions](/account-and-access/users-teams-groups-and-permissions).
- The website domains you want to use must already be added to your subscription. See [Domains](/account-and-access/domains).

## How the widget appears on your site

A widget only appears on a website whose domain is assigned to it, and only while the widget is enabled. When a visitor opens a page, Structurell matches the page's domain to your widgets. If no enabled widget has that domain, the chat doesn't appear.

Each domain can belong to one widget only. If you choose a domain that another widget already uses, saving fails with **These domains are already assigned to another chat widget**.

Portal doesn't show an embed code. The chat appears on websites that load the Structurell chat widget. If your site doesn't show the chat after you've assigned its domain, contact support to confirm your site includes it.

## Create a widget

1. Go to **Grow → Chat → Widgets** and select **New**.
2. Under **General**, enter a **Name**. This is required. It's for your team and isn't shown to visitors.
3. Leave **Enable public chat** switched on to let visitors use the widget. New widgets are enabled by default.
4. Enter a **Bot name** and a **Welcome message**. Visitors see both when the chat opens.
5. In **System prompt**, describe how the assistant should behave, for example your tone and what it should or shouldn't discuss.
6. In **Fallback message**, enter what the assistant says when it can't answer.
7. Enter a **Transcript from name**. Transcripts emailed to visitors show this as the sender's name.
8. Under **Assigned domains**, choose the website domains where the widget should appear.
9. Optionally choose a **Content domain** and a **Docs domain**, and add **Other connections** (see below).
10. Select **Save**.

The **Widgets** list shows your widgets. The tiles above it show **Active widgets**, **Conversations (30d)** and **Leads captured (30d)**. A lead here is a distinct visitor email address given in a chat over the last 30 days. Select a widget to edit or delete it.

## Choose knowledge sources

The assistant searches your knowledge sources before it replies. You can use any combination of these:

- **Content domain**: a website you manage in Structurell. The assistant searches its pages and posts. See [Content pages](/strengthen/content-pages).
- **Docs domain**: a knowledge base domain. The assistant searches its published articles. See [Attaching a docs domain](/enable/attaching-a-docs-domain).
- **Other connections**: other searchable sources, such as an external help centre that returns search results as JSON.

The widget also appears on the content and docs domains you choose, so you don't need to add them again under **Assigned domains**.

### Add another connection

Under **Knowledge sources**, add an item to **Other connections** and fill in:

- **Name** (required): a label for the source.
- **Connection**: optional. Choose a saved connection if the source needs to sign in. See [Connecting a provider](/connections/connecting-a-provider).
- **Entity search URL** (required): the address the assistant calls to search. It must start with `https://`. You can use `{query}` and `{locale}` placeholders, which are replaced with the visitor's question and language.
- **Entity read URL**: optional. The address used to read a single result. It can use `{id}`, `{slug}`, `{url}` and `{locale}` placeholders, must start with `https://` and must be on the same host as the search URL.

Each connection also has its own on/off switch, so you can pause a source without deleting it. You can add up to 20 other connections per widget.

## Troubleshooting

- **The chat doesn't appear on your site.** Check the widget is enabled and the site's domain is listed under **Assigned domains**. If it still doesn't appear, contact support.
- **Answers ignore your content.** Check the **Content domain**, **Docs domain** or other connections are set on the widget and that the content is published.