# Add Asks to any website with HTML

> Paste the Asks embed script right before the closing body tag on every page. It loads the AI chat widget asynchronously on any site you can edit.

To add the Asks AI chat widget to a website you control, paste one `<script>` tag right before the closing `</body>` tag on every page, then publish. The script loads asynchronously, so your page never waits for it, and it shows the chat launcher in the corner. On a site builder, follow its own guide instead: [WordPress](/channels/widget/install/wordpress), [Wix](/channels/widget/install/wix), [Squarespace](/channels/widget/install/squarespace), [Webflow](/channels/widget/install/webflow), or [Framer](/channels/widget/install/framer).

## Add the snippet

<Steps>

<Step title="Copy your snippet">

Open [Channels → Chat widget → Deploy](https://app.asks.app/channels/widget/deploy). Under **Choose how to install**, keep **Code snippet** and **HTML**. Under **Configure your code snippet**, select **For website visitors without logins**, unless customers sign in to your site (see [Logged-in customers](#logged-in-customers)). Then select **Copy**. Your snippet already contains your widget key:

```html
<script
  src="https://cdn.asks.app/embed.js"
  data-widget-key="YOUR_WIDGET_KEY"
  async
></script>
```

The widget key is public by design: it identifies your widget and grants no access to your account.

<Frame src="/images/get-started/onboarding-step-go-live.png" alt="Onboarding Put it on your site step with the Embed Code card showing the script tag and a Copy button, and the Installation status card watching for your site above the Email instructions to a developer button" caption="The same snippet appears in onboarding's last step and on the Deploy tab." />

</Step>

<Step title="Paste it before the closing body tag">

Paste the snippet immediately before `</body>`. If your site has a shared layout, footer partial, or include file, paste it there once so every page gets it. Otherwise paste it into each HTML file. Keep the `async` attribute.

</Step>

<Step title="Publish and open your site">

Upload or deploy the changed files, then open your site in a new tab. The launcher appears in the bottom corner within a few seconds.

</Step>

</Steps>

## Verify it works

On the Deploy tab, the **Installation status** card switches from "Watching for your site" to "Widget detected on" followed by your domain on the first page load that runs the snippet. Send a test message from your site: it appears in your [Inbox](https://app.asks.app/inbox), and the agent replies when it's on for the Chat widget at [AI agent → Deploy](https://app.asks.app/ai-agent/deploy).

<Frame src="/images/api/widget-identity-verification.png" alt="Chat widget Deploy tab scrolled to the Installation status card, which reads Widget detected on aurelia-skincare.com in green, between the server-side userHash code and the Identity verification (for users with logins) card" caption="Installation status turns green on the first page load with the snippet." />

<Frame src="/images/ai-agent/deploy.png" alt="Deploy AI Agent page with the AI Agent Status card active and the Deploy to Channels card listing Chat widget switched on and Active, then WhatsApp Business, Instagram, Facebook Messenger, and Telegram with their own switches" caption="The agent answers on your site when Chat widget is on here." />

## Logged-in customers

If customers sign in to your site, choose **For users with logins** before you copy. Your server renders the signed-in user's `data-user-id` and a `data-user-hash` (an HMAC-SHA256 of the id with your identity secret) on the script tag, and those customers keep their conversation history on every device. The server code for Node.js, Ruby, Python, PHP, Go, and Java is on the Deploy tab; the full setup is in the developer guide under [Logged-in users](/api/widget#logged-in-users).

## More from the same snippet

- **Single-page apps** — choose **Single-page app** under **Code snippet** and load the script once in your app shell. See [React & Next.js](/channels/widget/install/react-nextjs).
- **Inline chat** — add `data-container-id` to render the chat inside a section of a page, such as a contact page. See [Inline embed](/channels/widget#inline-embed).
- **Your own buttons** — any element with the `data-asks-open` attribute opens the widget when clicked.

## Troubleshooting

### The launcher doesn't appear

- **The snippet is in the head.** The widget attaches to the page body, so a script that runs before the body exists logs `[asks-widget] Failed to initialize widget` in the browser console. Move it right before `</body>`.
- **The widget isn't live.** Check that [Channels → Chat widget](https://app.asks.app/channels/widget) reads **Live**, and that Spotlight isn't the live website channel instead.
- **A Content-Security-Policy blocks it.** Allow the origins listed in the developer guide's [Content-Security-Policy](/api/widget#content-security-policy) table.
- **The key is wrong.** The widget's config request returns `404 Widget not found`. Copy the snippet again from the Deploy tab.

### The chat says "This chat isn't live yet"

Your workspace has no active plan or trial, so nobody can answer yet. Start one from [Plans & billing](/workspace/billing).

### The widget shows, but nobody replies

Turn on **AI Agent Status** and the **Chat widget** switch at [AI agent → Deploy](https://app.asks.app/ai-agent/deploy). With the agent off, messages still reach your Inbox for your team to answer.

## Related

- [All install guides](/channels/widget/install), including [Google Tag Manager](/channels/widget/install/google-tag-manager) when you can't touch your templates.
- [Widget customization](/channels/widget-customization) to match your brand.
- On asks.app: [the AI chatbot for websites](https://asks.app/ai-chatbot-for-website) and [the shared inbox](https://asks.app/shared-inbox) your team answers from.
