How to add a Chat Bubble to your website
TutorialJanuary 16, 202510 min read

How to add a Chat Bubble to your website

A quick step-by-step guide to installing the ChatPro chat bubble on top website builders (WordPress, Framer, Webflow, Shopify, Wix, Squarespace) and developer frameworks like React, Vue, Angular, and Next.js.

Andrés Olarte

Andrés Olarte

Author

If you’re here, it’s because you want to add a chat bubble or widget to your website. This will allow your customers to interact with your Agent and get 24/7 answers to any questions or requests they might have. You’re likely looking for something like this:

image

Before we begin, here is how to get your personal ChatPro script snippet.

How to get your script

  1. Go to your Chatpro dashboard
  2. Select the agent you want to embed in your website
  3. Click Connect

image

  1. Choose Chat Bubble

image

  1. Click on settings

image

You will find a script that looks like this:

<script src="https://d9kj22fn6emvi.cloudfront.net/web/chat.js" id="YOUR_AGENT_ID"></script>

Copy it. You will paste this into your site depending on the platform.

🔓Make sure your Agent is Public.

Popular Platforms

These are the most common tools people use to build websites, so we will start here.

WordPress

Option 1: Using the “Insert Headers and Footers” plugin

  1. Install the WPCode plugin
  2. Open Code Snippets
  3. Go to the Header section
  4. Paste your script
<script src="https://d9kj22fn6emvi.cloudfront.net/web/chat.js" id="YOUR_AGENT_ID"></script>

Save and you are done. ✅

Option 2: Adding directly to your theme

Open the file header.php inside your theme and paste this inside the head tag:

<script src="https://d9kj22fn6emvi.cloudfront.net/web/chat.js" id="YOUR_AGENT_ID"></script>

Framer

  1. Open your Framer project
  2. Go to Settings and then Code
  3. Scroll to Custom Code
  4. Paste your script in the Footer Code box

Publish the site. ✅

Webflow

  1. Go to Project Settings
  2. Open Custom Code
  3. Paste your script in the Footer Code area
<script src="https://d9kj22fn6emvi.cloudfront.net/web/chat.js" id="YOUR_AGENT_ID"></script>

Publish the site. ✅

Wix

  1. Go to Settings
  2. Open Custom Code
  3. Add New Snippet
  4. Paste your script
  5. Set it to run on All Pages and choose Body end

Save and publish it. ✅

Shopify

  1. Open Online Store
  2. Go to Themes and click Edit Code
  3. Open layout/theme.liquid
  4. Just before the closing body tag, paste:
<script src="https://d9kj22fn6emvi.cloudfront.net/web/chat.js" id="YOUR_AGENT_ID"></script>

Save your changes. ✅

Squarespace

  1. Open Settings
  2. Go to Developer Tools
  3. Click Code Injection
  4. Paste the script in the Footer box

Publish and your chat bubble will appear. ✅

Ghost CMS

  1. Open Settings
  2. Go to Code Injection
  3. Paste the script in the Site Footer

Save and publish your Ghost site. ✅

Developer Frameworks

Now let’s look at how to install ChatPro in the most common JavaScript frameworks.

React

Option 1: Add to public/index.html

This works if you are using Create React App.

<head>
  <script src="https://d9kj22fn6emvi.cloudfront.net/web/chat.js" id="YOUR_AGENT_ID"></script>
</head>

Option 2: Load it dynamically

You can also inject the script inside a component:

import { useEffect } from "react";

export default function App() {
  useEffect(() => {
    const script = document.createElement("script");
    script.src = "https://d9kj22fn6emvi.cloudfront.net/web/chat.js";
    script.id = "YOUR_AGENT_ID";
    document.body.appendChild(script);
  }, []);

  return null;
}


Next.js

App Router (Next 13+)

Add this inside app/layout.js:

import Script from "next/script";

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        {children}
        <script src="https://d9kj22fn6emvi.cloudfront.net/web/chat.js"
          id="YOUR_AGENT_ID"
          strategy="afterInteractive"
        />
      </body>
    </html>
  );
}


Pages Router

Add this to pages/_document.js:

<Head>
  <script src="https://d9kj22fn6emvi.cloudfront.net/web/chat.js"
    id="YOUR_AGENT_ID"
    ></script>
</Head>


Vue.js

Add to public/index.html

<head>
  <script src="https://d9kj22fn6emvi.cloudfront.net/web/chat.js" id="YOUR_AGENT_ID"></script>
</head>

Or load inside a component

export default {
  mounted() {
    const script = document.createElement("script");
    script.src = "https://d9kj22fn6emvi.cloudfront.net/web/chat.js";
    script.id = "YOUR_AGENT_ID";
    document.body.appendChild(script);
  }
};

Angular

Option 1: Add to angular.json

Open angular.json and add inside the scripts array:

"scripts": [
  "https://d9kj22fn6emvi.cloudfront.net/web/chat.js"
]

Then place the id in your index.html:

<script id="YOUR_AGENT_ID"></script>

Option 2: Add directly to index.html

<script src="https://d9kj22fn6emvi.cloudfront.net/web/chat.js" id="YOUR_AGENT_ID"></script>

Plain HTML Sites

Simply paste the script in your head or just before the closing body tag.

<script src="https://d9kj22fn6emvi.cloudfront.net/web/chat.js" id="YOUR_AGENT_ID"></script>

Your Chatpro AI chat bubble is now live 🎉

Share this article

Build AI agents for Free using ChatPro

Connect your data, get a custom AI Agent, and share it anywhere.

  • - Embed on your website
  • - AI Chat and Voice
Build your AI Agent FREE
AI Agent Illustration