On your website

Add chat to your website

Turn website chat on, make a key for your site, paste one line on every page and check the agent answers. Start to finish, with screenshots.

Website chat puts a chat button in the corner of your website. A visitor types a question and the agent answers on screen, with the same instructions, tools and knowledge it uses on the phone.

It takes four steps in the app and one line on your site:

  1. Turn website chat on.
  2. Create a website key for your site's addresses.
  3. Make it look like your site.
  4. Copy the line, then add it to your site.

Then check it works.

Before you start

  • The agent is published. The chat answers with the published version. Draft changes don't reach visitors until you publish.
  • You know every address your site answers on. Most sites have two, example.com and www.example.com. A site on a site builder often has a third, the builder's own address, such as example-store.myshopify.com or example.webflow.io.
  • You can add code to your site. Most site builders keep this behind a paid plan or an admin role. Each platform's page says what it needs.

1. Turn website chat on

Open the agent, then Channels > Website chat. On the Chat card, choose Turn on, then Turn on again to confirm.

The Website chat page with the Chat card switched off and its Turn on button

The card's label changes from Off to Not on your website yet. It reads Live once a visitor has sent a message through one of your keys. This is the same switch as Website chat on All channels, and it doesn't need a publish. If your plan doesn't include website chat, the card says so where the button would be.

With an assistant, call set_agent_channels with text in the list, such as ["voice", "text"] for an agent that also answers the phone.

2. Create a website key

A website key tells the chat which agent to talk to and which sites may use it. Under Website keys, choose Create key.

  1. Name: anything you'll recognise, such as the site's name.
  2. Environment: Live (production site) for your real site. Use Test (staging or local) for a copy of the site at another address.
  3. Allowed sites: every address your site answers on, one per line. List the bare domain and the www address separately, and add the site builder's own address if visitors or previews use it.
  4. Choose Create key, then Copy. The key is shown once.

Create website key with three allowed sites: example.com, www.example.com and a myshopify.com address

Each line is cut to its scheme and host, so https://www.example.com/shop becomes https://www.example.com. A line typed without https:// is read as https://, so type a site on your own computer in full, such as http://localhost:3000.

Key created, showing the new key once with a Copy button

You can't edit a key's allowed sites. To add an address later, create a new key with the full list, put it in your site, then revoke the old one. Revoking stops a key straight away.

The key isn't a secret. It sits in your page's source where anyone can read it. The allowed sites are what stop another website using it.

With an assistant, call create_publishable_key with allowedOrigins. Its reply holds the key once, as rawKey.

3. Make it look like your site

Under Chat widget look:

  • Accent: your brand colour as a hex value, such as #0f766e. It colours the chat button, the send button and the visitor's own messages.
  • Chat greeting: the first message a visitor sees. Set one when the agent's own greeting was written for the phone, such as "Thanks for calling".
  • Teaser message: an optional line in a small bubble beside the chat button, shown once to each visitor.
  • Welcome prompts: up to four buttons under the greeting, one per line. A tap sends that line as the visitor's first message.

Choose Save changes. Visitors see the change the next time they load a page, with nothing to publish.

Chat widget look with a teal accent, a chat greeting, a teaser and three welcome prompts

The same card sets the panel background, the text colour, corner rounding, the font, light or dark, and follow-up questions. The name and logo at the top of the panel come from Business details on All channels. Without them the panel shows the agent's name.

With an assistant, call set_widget_theme, and set_branding for the name.

4. Copy the line

On the Chat card, choose Get the code, then Copy snippet. Paste it somewhere you can edit it and swap pk_YOUR_PUBLISHABLE_KEY for the key you copied in step 2.

Install the chat widget, with the one-line snippet and Copy snippet

With your own key in it, the line looks like this:

<script src="https://app.verticalai.com.au/embed/widget.js" data-key="pk_live_xxxxxxxx" async></script>

The same line goes on every page. Put it just before your site's closing </body> tag, or in your site builder's footer code setting. If the builder only offers the page head, that works too: the line waits for the page to load. Add it once per page, because a second copy adds a second button.

Options under the snippet move the button, change its colour or hide the credit line. Install a widget lists them all.

5. Add it to your site

Your siteWhere the line goesWhat you need
Shopifytheme.liquid, just above </body>, or a Custom Liquid section in the theme's footerThe Themes staff permission, and Edit code for theme.liquid
WordPressThe Footer box of a header and footer plugin such as WPCodeAn administrator account. On WordPress.com, a paid plan
WixSettings > Custom code, on all pages, in Body - endA published site with a connected domain
SquarespaceCode injection > FooterA Core, Plus or Advanced plan
WebflowSite settings > Custom code > Footer code, then publishA paid site plan, or a Core, Growth, Agency or Freelancer workspace
Google Tag ManagerA Custom HTML tag on all pages, with a different snippetPublish rights on the container
Your own codeBefore </body> in your page template, or next/script in Next.jsAccess to the code and a deploy

On any other site builder, look for a setting called custom code, code injection, footer code, footer scripts or tracking code that applies to every page, and paste the line there.

6. Check it works

Open your site in a private window. That shows you what a visitor sees: no cached page, no editor preview and no browser extensions.

  1. The chat button sits in the bottom right corner in your accent colour. Your teaser, if you set one, shows a moment later.
  2. Click it. The panel opens with your chat greeting and welcome prompts.
  3. Ask something the agent should know. A reply means it works.

A website with the chat panel open, a visitor's question and the agent's reply

On a phone the panel opens full screen. When your site opens a drawer of its own and stops the page scrolling, such as a cart drawer or a mobile menu, the chat button steps aside until the drawer closes.

Back in the app, once a message has gone through, the key's row reads Last used with today's date, and the Chat card reads Live.

The key's row under Website keys, with its allowed sites and Last used today

When it doesn't work

Start with your browser's developer console on your site: right-click the page, choose Inspect, then open Console. When the chat panel can't start, it logs one line that begins [vertical ai widget] and says why. Visitors only see "Chat isn't available right now."

No chat button at all

  • The line isn't on the page. View the page's source and search for widget.js. Most site builders don't run custom code in their editor, so check the published site.
  • The line lost its key. Without data-key the line does nothing. Google Tag Manager strips it from a plain script tag, so use the Tag Manager snippet.
  • A content security policy blocks it. The console says it refused to load the script. Add https://app.verticalai.com.au to the policy's script-src, frame-src and connect-src.
  • A browser extension hides it. Ad and privacy blockers can hide chat buttons. Try a private window with extensions off.
  • You're seeing an old copy of the page. A caching plugin or your host's cache can keep serving the page from before you added the line. Clear the cache.
  • Another theme is live. On Shopify the line lives in one theme, and publishing a different theme leaves it behind.

The button shows, but chat isn't available

The panel reads "Chat isn't available right now.", and the button is usually the default near-black in place of your accent. The console line says why:

The console saysWhat to do
This site isn't on the key's allowed sitesCreate a key that lists this exact address. example.com, www.example.com and example-store.myshopify.com are three different sites.
The chat panel is switched off for this agentTurn chat on (step 1). Your plan may not include website chat.
The publishable key isn't validThe key was revoked or mistyped. Put a current key in the line.
Couldn't reach the agent serviceThe panel couldn't reach app.verticalai.com.au, often a network or firewall that blocks it. Try again on another network.

A chat panel on a site that isn't on the key's allowed sites

Other problems

  • The panel stays blank. A content security policy without frame-src https://app.verticalai.com.au blocks the panel.
  • Chat works but the button isn't your colour. A content security policy without connect-src https://app.verticalai.com.au stops the button loading your colours.
  • The button covers part of your page. Lift it with data-offset-bottom or move it with data-position="left" (script attributes).
  • Replies are wrong or out of date. The chat runs the published version. Try the question in the agent's Test panel, fix it, then publish.
  • Chat stops answering on every site. Website chat pauses while a payment is overdue or the workspace is at its spend limit. See Billing.

What happens after a chat

Every chat is saved. It shows in Conversations with the Chat channel, the agent and the transcript. Pick the agent in the agent filter to see only its conversations.

A website chat in Conversations, with the Chat channel, the agent and the transcript

A chat doesn't get the after-call work a phone call gets. There's no summary, no scoring, no call alerts and no webhooks, and the agent's hang-up and post-call functions don't run.

Getting a chat to a person

Because nothing runs after a chat, the agent has to pass it on during the chat.

  • Take a message. Add the built-in take_a_message tool (Built-in tools). It emails the visitor's name, details and request to your inbox. A chat has no caller ID, so tell the agent in its instructions to ask for a phone number or email before it takes the message.
  • Hand the chat to a person by text. set_chat_handoff, over the MCP, texts up to five people when a visitor starts a chat: a short reference, the first message and a link to the whole chat. The agent keeps answering until one of them replies to the text. Their reply shows in the visitor's chat under their name, and the agent stops answering that chat. The texts come from a mobile number your workspace owns and are billed as texts. There's one alert per chat, and at most 10 an hour across the workspace.
  • Your own systems. The agent's other tools can run in a chat too, such as an HTTP tool that books an appointment or adds a lead to your CRM. See Tools.

What it costs

Adding the line costs nothing. Each plan includes a number of website chat conversations a month. Billing has the allowances and what happens past them.

On this page