# Install the widget on your website

> Add the TalkDemo widget to your website with one script tag, list the origins allowed to embed it, and choose the button text and position.

Source: https://talkdemo.com/help/embed-and-links/install-the-widget · Updated 2026-11-20

## Key takeaways

- The widget is one script tag that adds a floating demo button to your site.
- The widget only opens on origins you allow, such as https://www.example.com. On any other site the demo is refused.
- You choose the button text and whether it sits bottom right or bottom left, and see a live preview before you copy.
- The agent must be Live for prospects to start a demo from the widget.

The widget puts a demo button on your website. A visitor clicks it and the demo opens in a window on the same page, with no install or login. You add it with one script tag.

**Who can do this:** Admin, Member. Viewers can copy the snippet but not change origins.

## Allow your website

The widget only opens on websites you list, so nobody can put your agent on their site.

1. Open **Agents**, choose the agent and open **Embed & links**.
2. Under **Where it may run**, type each site in **Allowed origins**, with the scheme and host, such as `https://www.example.com`, and click **Add**. Add `https://example.com` separately if visitors use both.
3. Click **Save embed settings**.

An origin is the scheme, host and port, never a path. Use https (plain http works only for `localhost` while you test).

## Add the script tag

1. Under **Website widget**, set the **Button text** (up to 40 characters, such as "See it live" or "Live demo dekhiye") and the **Button position** (bottom right or bottom left). The preview beside them shows the button as it will look.
2. Click **Copy snippet**. The button turns into **Copied** for a moment. The snippet looks like this, with your agent's id:

```html
<script async src="https://app.talkdemo.com/widget.js" data-agent="YOUR_AGENT_ID" data-label="See it live"></script>
```

3. Paste it before the closing `</body>` tag on every page where the button should appear. Most site builders and tag managers have a place for custom code.
4. Publish your site and open a page. The button appears in the corner you chose.
5. Click it and run a short demo to check it works.

The button text and position live in the snippet, so copy it again after you change them. On paid plans with your own theme (**Branding**), the snippet also carries your accent for the button (`data-color`), your corners (`data-corners`) and your background for the window (`data-background`); copy it again after a theme change too. See [Brand the call page, start and end screens](/help/agents/branding-start-and-end-screens). If the agent is still a draft, a notice at the top of the page says so: set everything up, test it in the console, then publish.

## What visitors see

Clicking the button opens the demo in a window over your page (full screen on phones). Keyboard focus stays in the window while it is open. **Escape**, the close button or a click outside the window closes it and returns focus to the button. The demo itself works as described in [Joining a live demo](/help/for-prospects/joining-a-demo).

## If the demo doesn't open

- The page's origin isn't on the list: the button shows, but the window stays empty or says the demo can't be shown here. Check `www` and non-`www`, and the port if you use one.
- The agent isn't **Live**. See [Publish, pause and the public link](/help/agents/publish-pause-and-public-link).
- Your site's content security policy blocks the script. Allow `https://app.talkdemo.com` in `script-src` and `frame-src`.
- The link was rotated. Copy the new snippet.

**Privacy:** the widget does not start a call or record anything until a visitor clicks it. When a visitor starts a demo, the call page shows the recording notice before anything is recorded. Mention TalkDemo demos in your own privacy notice.

## Frequently asked questions

### Does the widget slow my site down?
The script loads asynchronously, and the call itself loads only when a visitor clicks.

### Can I use different agents on different pages?
Yes. Each agent has its own snippet. Put one snippet on each page.
