Add the chat bubble to your website

Install the Askocto chat bubble with one script tag, then set its position, colors and visibility from the Website widget channel.

Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.

The chat bubble is a round launcher in the corner of your site. Visitors select it to open a chat window with your agent. Use this page to install it, change how it looks and fix the usual reasons it does not appear.

Install the bubble

  1. Open your agent and go to Channels > Website widget.
  2. Select Install and copy the snippet.
  3. Paste it into the HTML of every page that should show the bubble, just before the closing body tag.
  4. Reload the page.
<script
  src="https://cdn.askocto.co/embed.js"
  data-agent-id="agt_123"
  defer
></script>

You should see the launcher in the bottom corner of the page. Select it and the chat window opens with your agent's greeting.

Note: The bubble only appears for a published agent. If the agent still has unpublished changes, publish them first. See Versions.

Appearance settings

These settings live in Channels > Website widget > Appearance. They apply to every page that uses the snippet, so you do not need to edit your site after changing them.

Setting What it does
Position Places the bubble at the bottom right or bottom left.
Brand color Sets the color of the launcher and the customer's message bubbles.
Launcher icon Replaces the default icon with your own image.
Launcher label Adds short text next to the icon, such as "Ask us".
Allowed domains Lists the domains where the bubble may load. Leave it empty to allow any domain.

Script attributes

You can also set a few options on the script tag. An attribute wins over the dashboard setting for that page.

Attribute Values Effect
data-agent-id agt_... Required. The agent to load.
data-position right, left Overrides the bubble position.
data-launcher hidden Hides the bubble so your own button can open the chat.

To open the chat from your own button, hide the launcher and call open(). See Chat interface control.

Single-page apps

Add the snippet once, in the root HTML file or the layout that wraps every route. Do not mount it per page, or the bubble loads more than once. When a customer signs in, call identify so the conversation belongs to them. See Identity verification.

Troubleshooting

  • No bubble appears. Check that the agent is published, that the agent id in the snippet is correct and that the page domain is in Allowed domains.
  • The browser console shows a blocked request. If your site sets a content security policy, allow cdn.askocto.co for scripts and api.askocto.co for connections.
  • The bubble loads twice. Remove the duplicate snippet from your layout or template.
  • Color changes do not show. Hard-refresh the page. The browser may hold an older copy of the settings.

For the full set of options, return to the website integration overview.

Something unclear or missing? Tell us and we will fix the page.