How to Add an AI Chatbot to Squarespace (Code Injection Guide)
Learn how to install an autonomous AI customer support chatbot on Squarespace 7.1 or 7.0 in under 3 minutes. Step-by-step instructions for Footer Code Injection, inline container embedding, and automated sitemap crawling.
Squarespace explicitly locks external JavaScript and the Code Injection tool on the entry-level Personal plan. To embed Knogents (or any third-party script), your Squarespace site must be on a Business, Commerce (Basic/Advanced), or Enterprise plan. If you are currently on a Personal plan, you will need to upgrade inside your Squarespace billing settings before proceeding.
Step 1: Configure Your Chatbot Parameters in Knogents
Before copying the script into Squarespace, set up your agent in the Knogents dashboard with these production-tested parameters:
| Parameter | Recommended Setting | Technical Reason |
|---|---|---|
| Display Mode | floating or inline | Choose floating for a site-wide corner bubble, or inline if embedding inside a dedicated Support page layout. |
| Confidence Threshold | 0.72 – 0.78 | Prevents hallucinating answers when user questions are not covered in your Squarespace pages. |
| Knowledge Sources | Sitemap + PDF Specs | Point Knogents to https://yourdomain.com/sitemap.xml to auto-ingest all published pages and blog posts. |
| Lead Escalation | Email Alerts | Configure your notification email for instant lead capture and conversation transcripts. |
Step 2: Choose Your Installation Method
This is the standard installation for having a floating chat bubble appear across all pages of your Squarespace site:
- Log in to your Squarespace Account and open your website manager.
- In the left sidebar, navigate to Website Tools > Code Injection (In Squarespace 7.0, navigate to Settings > Advanced > Code Injection).
- Scroll down past the Header box to the FOOTER code injection area.
- Paste your Knogents script tag into the FOOTER field:
<script async src="https://knogents.com/embed.js" data-agent-id="YOUR_AGENT_ID"> </script>
Injecting the script in the Footer ensures your HTML DOM, CSS styles, and hero images finish rendering first. The async attribute ensures Knogents loads non-blockingly without delaying your site's Largest Contentful Paint (LCP).
If you prefer embedding the chat interface directly into the layout of a dedicated "Support" or "Contact" page instead of a floating bubble:
- Edit the target Squarespace page in the page editor.
- Click Add Block and select the Code block.
- In the Code block settings panel, set the language dropdown to HTML and make sure Display Source is toggled OFF.
- Paste the following container snippet:
<!-- Knogents Dedicated Inline Support Portal --> <div id="rag-inline-bot" style="min-height: 540px; width: 100%; border-radius: 12px; overflow: hidden;"></div> <script async src="https://knogents.com/embed.js" data-agent-id="YOUR_AGENT_ID"> </script>
The Knogents loader detects the presence of the #rag-inline-bot container and automatically renders the chat interface directly inside the block rather than as a floating corner button.
Step 3: Verification & Squarespace Quirks
Squarespace deliberately turns off custom injected scripts while you are editing sections in Fluid Engine. Do not worry if the chat widget does not show up inside the editor. Open your published website URL in a separate private or incognito window to see the live bot.
Some older Squarespace 7.0 templates use Ajax page loading (PJAX), which switches page content without a full browser reload. Knogents' loader script (embed.js) includes built-in MutationObserver hooks and listens for Squarespace's internal navigation events (mercury:load), ensuring the chat widget persists smoothly across page clicks.
Whenever you publish new blog posts or modify page text in Squarespace, Knogents automatically re-indexes your site based on your plan schedule (Weekly on Basic, Daily on Standard). You can also click "Sync Now" in the Knogents dashboard to trigger an immediate crawl.
Frequently Asked Questions
Does Knogents slow down my Squarespace website?
No. The Knogents embed script is under 18KB gzipped and loads asynchronously from global edge CDNs. Because it runs after your initial DOM content loads, it does not impact your Google Lighthouse or Core Web Vitals speed scores.
Can I style the chatbot colors to match my Squarespace theme?
Yes. In the Knogents dashboard, you can customize the primary brand color, header avatar, greeting message, and launcher icon without writing any CSS.
Add an AI Chatbot to Your Squarespace Site Today
Start with 100 free messages. Ingest your Squarespace sitemap, customize your widget, and paste the 1-line script.