Before you start
- Role: Manager or higher on the chatbot. See Invite and manage team members.
- Access to your website’s code, or to the “custom code” settings of your website builder.
- Optional: test your chatbot first with the preview in your dashboard. See Control where the chatbot appears.
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.
YOUR_CHATBOT_ID.
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.
- HTML
- WordPress
- Shopify
- Squarespace
- Wix
- Webflow
- Other platforms
- Open the HTML of your page, or of the template that all your pages share.
- Paste the code just before the closing
</body>tag, or in the<head>section. - Save the file and upload it to your web server.
Check that it works
- Open your website in a new private browser window.
- Wait a few seconds. The chat icon shows in the bottom corner of the page.
- Select the chat icon and ask a question that your content answers. The chatbot answers.
The chat icon does not show
The chat icon does not show
- 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.
The chat shows on some pages but not others
The chat shows on some pages but not others
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.