DocsAutomate & integrateEmbed the chat widget

Embed the chat widget

One <script> tag puts the DMtoLead chat widget on any website. Full reference for every data-* attribute below.

See it live
DMtoLead's own marketing site uses this widget (the chat button bottom-left of dmtolead.com). The config is in our layout.js — feel free to inspect.

Minimal embed (2 attributes)

The widget needs data-user and data-automation at minimum. Find both in your dashboard under Embed settings.

html
<script
  src="https://dmtolead.com/embed/widget.js"
  data-user="YOUR_WORKSPACE_ID"
  data-automation="YOUR_AUTOMATION_ID"
  async
></script>

Paste anywhere in your site's HTML — just before </body> is conventional. The script is loaded async; it won't block your page render.

Full snippet with common attributes

html
<script
  src="https://dmtolead.com/embed/widget.js"
  data-user="YOUR_WORKSPACE_ID"
  data-automation="YOUR_AUTOMATION_ID"

  data-primaryColor="#ccff00"
  data-bgColor="#0a0a0a"
  data-userBubble="#ccff00"
  data-botBubble="#1a1a1a"
  data-userText="#000000"
  data-botText="#ffffff"
  data-headerBg="#ccff00"
  data-headerText="#000000"

  data-botName="Acme Bot"
  data-logoIcon="Bot"

  data-position="bottom-right"
  data-fabSize="56"
  data-windowWidth="360"
  data-windowHeight="520"
  data-borderRadius="16"
  data-fontFamily="Inter, system-ui, -apple-system, sans-serif"
  data-fontSize="14"
  data-launcherStyle="button"
  data-launcherAnimation="pulse"

  data-welcomeMsg="Hi! Ask me anything about our products or shipping."
  data-placeholder="Type a message..."
  data-typingText="Acme is typing"
  data-statusText="Online — replies in 2s"
  data-poweredByText="Powered by DMtoLead"
  data-poweredByLink="https://dmtolead.com"

  data-preChatEnabled="false"
  data-showReset="true"
  data-showOnlineDot="true"
  data-onlineColor="#22c55e"

  async
></script>

All supported attributes

Every attribute below maps 1:1 to a data-* attribute on the script tag. Strings only (HTML attributes coerce everything to strings).

Auth (required)
AttributeDescription
data-userWorkspace ID. Get this from your dashboard's Embed settings.
data-automationAutomation ID this widget should route to. Optional if you only have one automation.
Theme — colors
AttributeDescription
data-primaryColorPrimary brand color (hex). Default: #ccff00.
data-secondaryColorSecondary color (hex).
data-accentColorAccent color (hex).
data-bgColorWidget background (hex).
data-userBubbleUser message bubble color (hex).
data-botBubbleBot message bubble color (hex).
data-userTextUser message text color (hex).
data-botTextBot message text color (hex).
data-headerBgWidget header background (hex).
data-headerTextWidget header text (hex).
Bot identity
AttributeDescription
data-botNameDisplay name shown in the widget header. e.g. "Acme Support".
data-logoUrlFull URL to your logo image (40×40px recommended).
data-logoIconLucide icon name as fallback when logoUrl is empty. e.g. "Bot", "MessageCircle", "Sparkles".
Layout & behavior
AttributeDescription
data-positionWidget anchor. "bottom-left" or "bottom-right". Default: "bottom-left".
data-fabSizeFloating button size in pixels. Default: "56".
data-windowWidthChat window width in pixels. Default: "360".
data-windowHeightChat window height in pixels. Default: "520".
data-borderRadiusWindow corner radius in pixels. Default: "0" (square).
data-fontFamilyCSS font-family stack. Default: "Inter, system-ui, -apple-system, sans-serif".
data-fontSizeBase font size in pixels. Default: "14".
data-launcherStyle"button" or "label". Default: "button".
data-launcherAnimation"pulse", "bounce" or "none". Default: "pulse".
data-triggerOnScrollShow widget after the user scrolls this percent of the page. Default: "60".
Pre-chat form
AttributeDescription
data-preChatEnabled"true" to show a contact-info form before chat starts. Default: "false".
data-preChatRequireName"true" to require name. Default: "true" (only matters if preChat is enabled).
data-preChatRequireEmailDefault: "true".
data-preChatRequirePhoneDefault: "false".
data-preChatTitleHeading on the pre-chat form.
data-preChatSubtitleSubheading on the pre-chat form.
data-preChatSubmitLabelSubmit-button label.
data-preChatNameLabelName field label.
data-preChatEmailLabelEmail field label.
data-preChatPhoneLabelPhone field label.
Copy & text
AttributeDescription
data-welcomeMsgFirst message the bot sends when chat opens.
data-placeholderInput box placeholder.
data-typingTextText shown while the AI is composing. e.g. "Acme is typing…".
data-poweredByTextFooter attribution text.
data-showPoweredBy"true" or "false". Default: "true".
data-poweredByLinkURL the "powered by" attribution links to.
data-launcherLabelTooltip on the floating button.
data-statusTextStatus line under the bot name. e.g. "Online — replies in 2s".
data-suggestedRepliesJSON array of {label, message} suggested-reply chips shown in the welcome screen.
Indicators
AttributeDescription
data-showReset"true" to show a "reset conversation" button. Default: "true".
data-showOnlineDot"true" to show a green online dot on the launcher. Default: "true".
data-onlineColorOnline-dot color (hex). Default: "#22c55e".

Multiple languages on one site

Embed two script tags, each with different copy attributes (and ideally different automation IDs for language-matched personalities). Use a tiny inline script to load the right one based on the page's language:

html
<script>
  const lang = document.documentElement.lang || 'en';
  const s = document.createElement('script');
  s.src = 'https://dmtolead.com/embed/widget.js';
  s.async = true;
  s.dataset.user = 'YOUR_WORKSPACE_ID';
  s.dataset.automation = lang === 'tr' ? 'TR_AUTOMATION_ID' : 'EN_AUTOMATION_ID';
  s.dataset.welcomeMsg = lang === 'tr' ? 'Merhaba!' : 'Hi!';
  document.head.appendChild(s);
</script>
Pre-chat form on lead-gen sites
Turn on data-preChatEnabled="true" to collect name + email before chat starts. The captured contact info attaches to the conversation in your DMtoLead inbox — useful when the widget is on a product page and the chat is a sales lead.