← All posts

· Feedbot team

How to Add a Chatbot to Your Website (Any Platform)

How to add a chatbot to a website in 4 steps: create and train the bot, embed one script tag, test it and set up handoff. Guides for 12 platforms inside.

Person coding on a laptop with HTML code on screen, showcasing development work
Photo: Lukas Blazek / Pexels

TL;DR. To add a chatbot to your website, create a bot in a chatbot tool, give it your content to answer from, copy its embed code (usually one <script> tag) and paste it into your site’s footer or custom code setting. On WordPress, Shopify, Wix, Squarespace and other builders that’s a settings screen, not a plugin. In React or Next.js it’s a component. The whole job takes 10 to 30 minutes, and most of that is checking the bot’s answers.

  • Step 1: pick a tool and create the bot.
  • Step 2: train it on your site, docs and FAQ.
  • Step 3: embed it with one script tag, Google Tag Manager or a framework component.
  • Step 4: test it, then set up notifications and human handoff.

The examples use Feedbot, which we make, but the steps are the same for almost any chatbot that gives you an embed code. Platform-specific guides are linked in the table below.

Step 1: Choose what kind of chatbot you need

Before installing anything, decide what the bot is for. It changes which tool you pick.

Goal What to look for
Answer customer questions AI chatbot that answers from your own content and says when it doesn’t know
Capture leads Collects name and email, sends leads to email, a CRM or a webhook
Talk to a person when needed Human handoff with notifications to your phone or team chat
Book appointments or take orders Integrations with your booking or store system, or actions that call your API
Collect feedback and bug reports Groups reports so you can see what repeats

For most small business and SaaS sites, the first three matter most. Our guide to chatbots for small business goes deeper on choosing.

Step 2: Create the bot and train it on your content

A chatbot is only as good as what it knows. Modern AI chatbots answer from a knowledge base you provide, using a technique called retrieval-augmented generation. (If you want the details, see our explainer on the RAG chatbot.)

In Feedbot, it looks like this:

  1. Sign up and create a bot from your site URL.
  2. Open Bot → Knowledge and add sources: a website page, the whole site, a sitemap.xml, files (PDF, DOCX, Markdown, TXT, CSV), plain text or an FAQ in Q: / A: form. The knowledge base docs list the limits per plan.
  3. Open Bot → Behavior and fill in the business profile: facts the bot should always know, such as prices, contacts and opening hours. Add custom instructions for tone and topics to avoid.

What to include, in order of value:

  • Pricing and plans, shipping and returns, refund policy.
  • Your top 20 support questions with clear answers. Pull them from your inbox.
  • Product or service pages, setup and how-to guides.
  • Contact details and when a person is available.

What to leave out: outdated pages, internal notes, anything you wouldn’t want quoted to a customer.

On Feedbot’s free plan the knowledge base is text and FAQ you add yourself. Website import and file uploads start on the $5 Starter plan. See pricing.

Step 3: Embed the chatbot in your website

This is the part people search for, and it’s the shortest. Almost every chatbot gives you a snippet like this one:

<script src="https://w.feedbotai.com/v1/feedbot.js" data-bot-id="YOUR_BOT_ID" async></script>

You find it in Dashboard → Bot → Install. Paste it right before the closing </body> tag of every page, or in whatever setting your platform has for site-wide footer code. The async attribute means it won’t block your page from loading.

Where to paste it on each platform

Platform Where the code goes Full guide
WordPress A header-and-footer plugin such as WPCode (Footer box), or your child theme’s wp_footer hook WordPress
Shopify Your theme’s code, in the theme.liquid layout before </body> Shopify
Wix Settings → Custom Code → Add Custom Code, placed in “Body – end” (needs a connected domain) Wix
Squarespace Code Injection, Footer field (Core, Plus and Advanced plans) Squarespace
Webflow Site settings, custom code, footer code; then publish Webflow
Framer Site settings, custom code, end of <body> Framer
Ghost Settings, code injection, site footer Ghost
Bubble App settings for page header scripts, or an HTML element on the page Bubble
Google Tag Manager New Custom HTML tag, trigger All Pages, then submit and publish Google Tag Manager
React The @feedbotai/react package and its FeedbotWidget component React
Next.js next/script in app/layout.tsx, or the React package Next.js
Vue Load the script once in your app shell or index.html Vue
Plain HTML Paste before </body> in every page or your shared footer include Install docs

There is no Feedbot plugin or app to install on WordPress, Shopify or Wix. You paste the script through each platform’s own custom code feature, which also means there’s nothing to update later. Some builders only allow custom code on paid plans; each guide notes the requirement.

React and Next.js

In a Next.js App Router project, load the script in your root layout:

import Script from "next/script";
<Script
src="https://w.feedbotai.com/v1/feedbot.js"
data-bot-id="YOUR_BOT_ID"
strategy="lazyOnload"
/>

Or install the React package, which wraps the same loader in a component and a useFeedbot() hook for opening the chat or sending a message from your own buttons:

Terminal window
pnpm add @feedbotai/react
import { FeedbotWidget } from "@feedbotai/react";
<FeedbotWidget botId="YOUR_BOT_ID" />

If your users log in, you can pass their id and email with a hash computed on your server so the bot knows who it’s talking to. See Identify users.

Embedding the chat inside a page instead of a floating button

A floating button in the corner is the default. If you want the chat to sit inside a page, for example on a Help or Contact page, use inline mode:

<div id="chat" style="height: 560px"></div>
<script
src="https://w.feedbotai.com/v1/feedbot.js"
data-bot-id="YOUR_BOT_ID"
data-mode="inline"
data-container="#chat"
async
></script>

No access to the site’s code?

Use a hosted chat link instead. Every Feedbot bot has one, like https://w.feedbotai.com/chat/?bot=YOUR_BOT_ID. Link to it from a “Chat with us” button, an email signature, a QR code or a mobile app’s web view. See Chat link.

Step 4: Test the chatbot before you announce it

Open your site in a private browser window and run through this list:

  1. The button appears on desktop and on a phone. (On narrow screens the chat usually opens full screen.)
  2. Ask your top 10 real questions, phrased the way customers write them, typos included. Check each answer against your docs.
  3. Ask three questions your content doesn’t cover. The bot should say it doesn’t know and offer a next step, not invent an answer.
  4. Ask in another language if you have international visitors.
  5. Ask for a human and make sure the handoff reaches you.
  6. Check the conversation appears in your dashboard inbox.

Then restrict where the bot can run. In Feedbot that’s Bot → Install → Allowed domains: list your domains so nobody can copy your snippet and use your bot and quota on their site.

Troubleshooting

Symptom Likely cause Fix
Button doesn’t appear Code saved but site not republished, or pasted into a field that strips scripts Publish again; check the platform allows custom code on your plan
Works on some pages only Code added to one page or template instead of site-wide Move it to the global footer setting or a GTM tag on All Pages
Button appears, chat won’t connect Your domain isn’t on the allowed domains list Add the domain, including staging domains you test on
Two chat buttons An old chat widget is still installed Remove the old snippet or app
Bot answers “I don’t know” to basics The fact isn’t in the knowledge base Add the page, or write it as an FAQ entry
Page feels slower A heavy widget loading synchronously Use async or lazyOnload; the Feedbot loader is about 6 KB gzipped and lazy-loads the chat

After launch: notifications, handoff and leads

A chatbot that nobody watches turns into a dead end. Set up three things in the first week:

  • Notifications. Connect Telegram, Slack, Discord or email so important conversations and new leads reach you. Feedbot can filter by priority and category so you’re not pinged for every “hi.”
  • Human handoff. Let the bot pass a conversation to a person when the visitor asks or the bot can’t help. In Feedbot your team replies from Telegram or the inbox, and replies go out by email if the visitor has left. See Human handoff.
  • A weekly review. Read the conversations the bot couldn’t answer and add the missing content. This is where answer quality really improves.

If you’re still deciding whether you need a bot at all or a person answering, our post on chatbot vs live chat compares the two.

Questions

Can't find an answer? Ask the bot in the corner, or write to us.

Can I add a chatbot to my website for free?

Yes. Many chatbot tools have free plans. Feedbot's free plan includes 50 conversations a month and answers from text and FAQ you add yourself; importing your website and uploading files starts on the $5 Starter plan.

Do I need to know how to code to add a chatbot?

No. You copy one line of code from the chatbot's dashboard and paste it into your site builder's custom code or footer setting. The only coding involved is knowing where that setting is, and each platform guide shows it.

Can I integrate ChatGPT with my website?

Not by pasting ChatGPT itself. You can call OpenAI's API from your own code, or use a chatbot tool built on a language model that answers from your site's content and gives you an embed code. The second option takes minutes and avoids the bot answering from general knowledge.

Will a chatbot slow down my website?

It shouldn't if the script loads asynchronously and fetches the chat only when needed. Check the vendor's loader size and test your page speed before and after installing.

How do I create a chatbot for my website that answers from my own content?

Use a knowledge base chatbot: point it at your site URL, sitemap or documents, let it import them, and it searches that content for every answer. Add an FAQ for anything missing and test with real customer questions.

Can I show the chatbot only on certain pages?

Usually yes. Most site builders let you add code to specific pages, and Google Tag Manager can fire the tag only on pages you choose. In code-based sites, render the script only in the layouts or routes where you want it.

Put one agent on your site today

Start on the free plan. Upgrade when conversations grow.