Skip to main content
To show your chatbot on your website, you add one script to your site. The script adds a chat icon to the corner of every page that has the script.

Before you start

Copy the embed code

1

Open Installation

In your chatbot’s sidebar, select Installation.
2

Copy the JavaScript embed

In Embed Options, find JavaScript Embed. Select Copy.
The code looks like this. Your copy already has your chatbot ID in place of YOUR_CHATBOT_ID.
Always copy the code from your Installation page. Do not type it by hand.

Add the code to your website

You can paste the code in the <head> section or just before the closing </body> tag. Both work. The script loads in the background, so it does not slow down your page.
  1. Open the HTML of your page, or of the template that all your pages share.
  2. Paste the code just before the closing </body> tag, or in the <head> section.
  3. Save the file and upload it to your web server.
Add the code to every page where you want the chat, or to a shared layout so it is on all pages.

Check that it works

  1. Open your website in a new private browser window.
  2. Wait a few seconds. The chat icon shows in the bottom corner of the page.
  3. Select the chat icon and ask a question that your content answers. The chatbot answers.
  • Check that the code is on the page. View the page source and search for sitegpt.
  • Check that the chatbot ID in the code matches the ID on your Installation page.
  • If you set Allowed Domains, check that your website’s domain is in the list. The browser console shows a message from SiteGPT if the domain is not allowed. See Control where the chatbot appears.
  • If the page is in Excluded Pages, the chat icon does not show on it.
  • The script does not load if the chatbot is disabled, or if the account has no active subscription.
  • Ad blockers and strict Content Security Policy rules on your site can block the script.
For more fixes, see Troubleshooting.
The code must be on every page where you want the chat. Put it in a shared layout, theme file, or site-wide custom code setting.

Embed code options

You can add options to the end of the script URL in the code. For example, .../widget/YOUR_CHATBOT_ID.js?mobile=false. To use more than one option, join them with &: .../widget/YOUR_CHATBOT_ID.js?mobile=false&delay=5000. To open, close, or control the chat from your own code, see the JavaScript widget SDK. To send chat events to your analytics, see Tracking events.