# Website widget

> The script tag, its attributes, placing it inside a page, and the JavaScript API.

- Canonical page: https://synconone.com/docs/website-widget
- Section: Customer experience
- Updated: 2026-10-22

The widget is one script. It loads your site's configuration, then the widget itself, and renders inside a shadow root, so your page's styles never reach it and its styles never reach your page.

## The script tag

Copy the tag from the site's Deploy tab and paste it before the closing `</body>` tag on every page where the agent should appear.

```html
<script src="https://synconone.com/widget/v1/loader.js" data-site-id="YOUR_SITE_ID" async></script>
```

## Attributes

| Attribute | Required | What it does |
| --- | --- | --- |
| `data-site-id` | Yes | Which site the visitor is on. Your Deploy tab fills it in. |
| `data-embed` | No | A CSS selector. The widget renders inside that element instead of floating over the page. |
| `data-api-base` | No | Where the platform lives. Leave it out; it defaults to where the script loaded from. |

## Place it inside a page

To put the conversation in your layout, for example on a contact page, add an element and name it in `data-embed`. You can also choose the embedded layout for the site in Design.

```html
<div id="ask-us"></div>
<script src="https://synconone.com/widget/v1/loader.js" data-site-id="YOUR_SITE_ID" data-embed="#ask-us" async></script>
```

## JavaScript API

Once the script is on the page, `window.SynconLead` lets your own code open and close the widget, ask on the visitor's behalf, or pass on who they are. Calls made before the widget has loaded are queued and run when it is ready.

```javascript
// Open or close the panel
window.SynconLead.open();
window.SynconLead.close();

// Open the panel and send a message as the visitor
window.SynconLead.ask("Do you deliver on Saturdays?");

// Tell the widget who is signed in on your site
window.SynconLead.identify({ email: "customer@example.com" });
```

> **identify is not proof of identity** `identify` fills in the visitor's email so they are not asked for it again. It is not verified, so do not use it to grant access to anything.
