Skip to main content

Overview

The chat widget is a single <script> tag you add to your website. Visitors who open it are answered by your AI agent, and the conversation appears in Craft alongside every other lead.

By default every page shares one agent. A page tag lets you point one page — a careers page, a commercial-quotes page — at a different agent, while the rest of the site carries on as it is.


Add the widget

1

Copy the embed code

Go to Contact Center → AI CSR → Messaging Configuration. Set the colour, position and greeting, then click Copy Code.

2

Paste it into your site

Paste the snippet just before the closing </body> tag on every page the widget should appear on. It looks like this:

<script
  src="https://app.craftflow.co/messaging-widget-loader.js"
  data-config-id="your-config-id"
  async
></script>

Send one page to its own agent

Give the embed on that page a tag, and add a trigger that routes the tag to the agent you want.

1

Tag the page

On the Messaging Configuration page, fill in Page Tag — a short name for the page, like careers. The embed code gains a data-source attribute:

<script
  src="https://app.craftflow.co/messaging-widget-loader.js"
  data-config-id="your-config-id"
  data-source="careers"
  async
></script>

Use the tagged snippet on that page only, and the untagged one everywhere else.

2

Route the tag to an agent

Go to Contact Center → Agents → Triggers and add a trigger: channel Web chat, source careers, sent to the agent that should answer those chats.

Create the trigger before the tagged snippet goes live. A tagged page with no trigger is answered by your default agent, exactly as an untagged page would be.

Tagged pages keep their own conversations: a visitor who chatted on your homepage and then opens the chat on a tagged page starts a fresh conversation there, rather than resuming the one they left open.


What Craft records

Every web chat records the page it started on, so you can see which pages produce leads, and a trigger can match on it:

FieldExampleNotes
SourcecareersThe data-source tag, if the embed has one
Page URLhttps://example.com/careersThe page the chat started on, without its query string

Options

All of these are attributes on the <script> tag; the Messaging Configuration page writes them for you.

AttributeDefaultWhat it does
data-config-idRequired. Identifies your account.
data-sourcenoneTags the page so a trigger can route its chats.
data-primary-color#0F172AButton and header colour.
data-positionbottom-rightbottom-right or bottom-left.
data-offset-x / data-offset-y24Distance from the edge, in pixels.
data-header-titleChat with usTitle inside the chat window.
data-greetingHi there! How can we help you today?Bubble shown before the chat is opened.
data-empty-state-textSend us a message…Shown before the first message.
data-launcher-textnoneText beside the chat button.
data-input-placeholderType a message...Placeholder in the message box.
data-auto-openoffMilliseconds to wait, then open the chat automatically.
data-soundtrueSet to false to silence the new-message sound.