Docs menu

Code and frameworks

Add TailGPT to Any Website

About five minutes, if you can change your website’s files.

Before you start

Step 1: Copy your code

Your code is on your chatbot's page in the TailGPT dashboard: open Chatbots, choose your chatbot, and find the Code box. Click Copy code. Until you have a plan the code is blurred, with Subscribe beside it.

A chatbot's page in the TailGPT dashboard, with the Code box and its Copy code button

It looks like this, with your own key where this one says YOUR_WIDGET_KEY:

<script src="https://app-tailgpt.tailwebs.com/widget.js" data-key="YOUR_WIDGET_KEY"></script>

Copy yours from the dashboard - this example will not work on your site.

Step 2: Find the end of the page

Open one of your pages in a text editor and find the line </body>, near the end of the file.

If your site keeps its footer in one shared file - a template, an include or a layout that every page uses - open that file instead. Then you add the code once and every page has it.

Step 3: Paste your code above it

Put your code on its own line, just above </body>:

    <script src="https://YOUR-TAILGPT-ADDRESS/widget.js" data-key="YOUR_WIDGET_KEY"></script>
  </body>
</html>

Use your own code from the dashboard, not this example.

Step 4: Repeat on every page

If you pasted into a shared footer file, skip this step. Otherwise, add the same line above </body> on every page where you want the chat bubble.

Step 5: Upload your changes

Save the files and upload them to your website the way you usually do. The chatbot appears once the new files are live.

Check it works

  1. Open your website in a private (incognito) window. A logged-in admin view and a cached page can both hide a change.
  2. Wait a few seconds for the chat bubble in the corner of the page.
  3. Ask it a question your website answers.
  4. In the TailGPT dashboard, open Chatbots. Once the bubble has loaded on a page of your website, your chatbot shows Live.
A chatbot on the TailGPT dashboard's Chatbots page, with its Live status highlighted

No bubble? Troubleshooting covers the usual reasons.

Stuck?

Start with Troubleshooting. Still stuck? Write to [email protected] with your website's address and the platform it is built on.

Where these steps come from