Onhand

Go live Add to your website

Add to your website

Put the assistant on your website with one line of code.

Before you start

Send your Onhand contact every domain the assistant should appear on, including staging, for example https://www.example.com and https://shop.example.com. For your security, the assistant only loads on domains you've approved.

We'll send you your install snippet with your assistant's id already filled in.

Install the snippet

  1. Copy the snippetIt looks like this:
    <script src="https://app.onhandagent.com/widget.js" data-bot="your-assistant-id" async></script>
  2. Paste it before </body>Add it to your site template so it appears on every page. The script loads in the background and doesn't slow your page down.
  3. Reload your siteThe chat launcher appears in the corner. If it doesn't, see troubleshooting.

Platform notes

PlatformWhere to paste it
WordPress / WooCommerceUse the Onhand plugin instead of the snippet.
ShopifyOnline Store → Themes → Edit code → theme.liquid, just before </body>.
React, Vue, Next.js and other appsAdd it once to your main HTML file or root layout, not to individual pages.
Google Tag ManagerA Custom HTML tag on all pages works. Pasting it directly into the site is more reliable.

Snippet options

Add to the tagEffect
data-auto-open="1"Opens the chat as soon as the page loads.
data-entry="…"Replaces the first message on this page (up to 400 characters).

Open the chat from your own buttons

Any button or link on your site can open the chat:

<button data-onhand-open>Ask a question</button>

<a href="#onhand">Chat with us</a>

Or from your own code, including asking a question for the visitor:

window.Onhand.open();

document.dispatchEvent(new CustomEvent("onhand:ask", {
  detail: { text: "What are your delivery times?" }
}));

For your IT team

Content Security Policy. If your site uses one, allow https://app.onhandagent.com for scripts, styles, connections, and images. Also allow images from https://www.google.com (small site icons next to source links) and, for stores, the host your product images come from.

Cookies. The chat sets no cookies on your domain and uses no tracking or advertising cookies. It keeps a random chat id and recent chats in the visitor's browser storage.

Isolation. The chat's styles are fully separated from your page, so it won't change your site's look and your styles won't break it.