Install the web chat on your site

Paste one line of code on your site (WordPress, Shopify, Wix, Webflow, Squarespace, Google Tag Manager, HTML, PHP, Next.js or React) and your visitors can write to you from a floating button.

Updated on November 3, 2026· 6 min read

The web chat puts a floating button on your site. When a visitor writes, the conversation arrives in your inbox as Web chat, just like WhatsApp ones. This guide is for the person who runs the business and for whoever builds the site: the steps are the same, only where you paste the code changes.

The code you will paste

  1. Go to Settings → General and scroll down to Web chat.
  2. Turn the chat on and copy the code shown, with your brand key:
<script src="https://app.turnflow.com.co/widget.js" data-brand="YOUR_KEY" async></script>
  1. Paste it on your site once, on every page where you want the button, preferably right before </body>.
General settings with the web chat section
Settings → General: the web chat code is on this screen

Always copy the code from your Settings screen: YOUR_KEY is your brand's key. If you paste the code twice on the same page, the chat still loads only once.

Button options

You can add attributes to the code:

Attribute What it does Example
data-lang Chat language data-lang="es" or "en"
data-color Main color data-color="#173d32"

On the same screen you customize the title, the greeting and the allowed domains (see below).

Where to paste it on your platform

Each platform renames its menus from time to time; if you can't find one, search its help for "custom code", "code injection" or "footer scripts".

WordPress

Option A, with a plugin (easiest): install a "headers and footers" plugin (for example WPCode or Insert Headers and Footers), open its Footer section, paste the code and save.

Option B, no plugin: add this to your child theme's functions.php (or to a plugin of your own). Don't edit a theme that updates itself: you would lose the change.

add_action('wp_footer', function () {
    echo '<script src="https://app.turnflow.com.co/widget.js" data-brand="YOUR_KEY" async></script>';
});

If you use a caching plugin, clear it after saving.

Shopify

  1. In the admin: Online Store → Themes.
  2. On your live theme click ⋯ → Edit code.
  3. Open layout/theme.liquid, find </body> and paste the code right above it.
  4. Save.

Wix

  1. In the site dashboard: Settings → Custom code (in some dashboards it is under Advanced).
  2. Add code, paste the script and give it a name.
  3. Under "Add code to pages" choose All pages, and under "Place code in" choose Body – end.
  4. Apply and publish the site.

Wix usually requires a paid plan with a custom domain to use custom code.

Webflow

  1. Site settings → Custom code.
  2. Paste the code in Footer code and save.
  3. Publish the site. It only works on the published site, not in the editor. This option needs a paid site plan.

Squarespace

  1. Settings → Advanced (in newer versions, Developer tools) → Code Injection.
  2. Paste the code in Footer.
  3. Save. Requires a plan that includes code injection.

Google Tag Manager

Useful when someone else controls the site and you only have GTM access.

  1. Create a new tag of type Custom HTML.
  2. Paste this code (it creates the script together with its attribute, which is the most compatible way in GTM):
<script>
(function () {
  var s = document.createElement('script');
  s.src = 'https://app.turnflow.com.co/widget.js';
  s.async = true;
  s.setAttribute('data-brand', 'YOUR_KEY');
  document.body.appendChild(s);
})();
</script>
  1. Trigger: All Pages. Save, use Preview to test, then Submit/Publish.

Static HTML

Open each page (or the shared template) and paste the code before </body>.

PHP

Paste the code in the footer file your pages share (for example footer.php), before </body>. It is plain HTML: no PHP needed.

Next.js

With the App Router, in app/layout.tsx:

import Script from "next/script";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script src="https://app.turnflow.com.co/widget.js" data-brand="YOUR_KEY" strategy="afterInteractive" />
      </body>
    </html>
  );
}

React (Vite, Create React App and similar)

Open index.html (in Vite it is at the root; in CRA, in public/) and paste the code before </body>. Don't put it inside a component: it would load again every time the component mounts.

Allowed domains

In Settings → General → Web chat you can list the domains where the chat may work, one per line and with https://, for example https://mystore.com. Empty means "any site".

  • List every variant you use: https://mystore.com and https://www.mystore.com are different domains.
  • No trailing slash and no paths.
  • If you test on your computer, also add http://localhost:3000 (or your port) while testing, and remove it afterwards.

How to check that it works

  1. Open your site in a private window (no extensions) and hard-reload with Ctrl/Cmd + Shift + R. The button should appear in the bottom-right corner.
  2. Send a test message. In Turnflow, go to the Inbox: a conversation tagged Web chat should arrive.
  3. For a closer look (optional, for developers): open the browser tools, Network tab. You should see widget.js with status 200 and a call to /api/widget/config answering "enabled":true.

What your visitors can do

  • Write messages and see when your team is typing.
  • Attach files (images, PDF, Office documents and text, up to 5 MB).
  • Come back later: the chat remembers the conversation in the same browser.

What you see

The conversation appears in the Inbox tagged Web chat. You reply as on any other channel; the visitor sees your reply in the chat. The bot and flows work here too.

The chat also sends, without you doing anything, the page the visitor is on; you can add more data (article, product, plan…) and, if your site has customer accounts, know who they are. See:

Common problems

  • The button doesn't show: check that the code is complete (with data-brand), that the web chat is turned on in Settings → General and that, if you set allowed domains, your site is on the list (with the same https:// and www, or without it).
  • The button shows but messages don't arrive: it is almost always the allowed domain. Try leaving the list empty for a few minutes to confirm.
  • I pasted it and nothing changed: clear your site's plugin or CDN cache (WordPress, Cloudflare, etc.) and reload without cache.
  • An ad or script blocker hides it: try a private window without extensions. If it works there, the person has an extension blocking the script; there is nothing to fix on your site.
  • Your site uses a Content-Security-Policy (CSP): whoever manages the site must allow https://app.turnflow.com.co in these directives: script-src (to load widget.js), connect-src (messages and files), img-src (attached images) and style-src 'unsafe-inline' (the button and window carry their styles inside the script itself; without this they appear unstyled).
  • I changed the color and can't see it: clear your browser cache or open the site in a private window.
  • The button covers another element: the chat lives in the bottom-right corner; if it collides with another floating button, move that one with your site's CSS.
Was this article helpful?