Add your agent to a Webflow site

Install the Askocto chat widget on a Webflow site with the embed script, republish the site and confirm the widget runs on every page.

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

This page shows how to add your agent's chat bubble to a site built in Webflow. You paste the embed script into the site's custom code, publish, and the bubble shows on every page.

Before you start

  • An agent with the Website widget turned on. See Channels.
  • Permission to edit and publish the Webflow site.
  • The agent ID from Channels > Website widget > Install.

Add the script

  1. Open the agent, select Channels > Website widget and choose Install.
  2. Copy the embed script.
<script src="https://cdn.askocto.co/embed.js" data-agent-id="agt_123" defer></script>
  1. In your Webflow site, paste the script into the custom code that loads on all pages, before the closing body tag.
  2. Save and publish the site.

You should see the chat bubble when you open the published site.

Show the widget on some pages only

To limit the bubble to certain pages, add the script to those pages' own custom code instead of the site-wide code. You can also hide the bubble and open the chat from your own button.

window.askocto.open();

The full list of methods is in Chat interface control.

Pass context from the page

Tell the agent what the visitor is looking at, so answers fit the page.

window.askocto.setContext({
  page: "pricing",
  plan: "Growth",
});

Context is available to the agent in that conversation. Pair it with UTM tracking to see which campaigns start chats.

Test it

  1. Open the published site in a private window.
  2. Ask a question the agent should know.
  3. Compare with Test > Playground to confirm the same sources are used. See Playground.

Remove the widget

Delete the script from the custom code and publish again.

Troubleshooting

  • No bubble on the live site. Confirm you published after adding the script.
  • The bubble appears twice. The script was added both site-wide and on a page. Keep one.
  • The wrong agent answers. Check data-agent-id against the agent's ID.

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