Squarespace Integration Guide
Add the Demeterics AI Chat widget to your Squarespace website using Code Injection.
Requirements
- A Squarespace website on Business, Commerce, or Enterprise plan
- A Demeterics AI Chat widget (get your widget key from the AI Chat dashboard)
Important: Code Injection with <script> tags requires a Business plan or higher. Personal plans cannot execute JavaScript.
Installation Steps
Step 1: Get Your Widget Code
- Log into your Demeterics dashboard
- Go to AI Chat
- Click on your widget
- Copy your Agent Key (e.g.,
DEM-A4E4OWSVGHBN)
Step 2: Access Code Injection
Squarespace 7.1 or newer:
- Go to your Squarespace dashboard
- Click Settings in the left sidebar
- Click Advanced
- Click Code Injection
Squarespace 7.0:
- Go to Settings → Advanced → Code Injection
Step 3: Add the Widget Code
- Scroll down to the Footer section
- Paste this code:
<!-- Demeterics AI Chat Widget -->
<script src="https://demeterics.com/widget/embed.js?k=DEM-YOUR-KEY-HERE" async></script>
<dem-agent name="default" title="Need help?" state="minimized"></dem-agent>
- Replace
DEM-YOUR-KEY-HEREwith your actual Agent Key - Click Save
Why Footer?: Squarespace recommends adding chat widgets and third-party scripts in the Footer to prevent performance issues and ensure proper loading.
Step 4: Test Your Widget
- Click Save and exit settings
- Visit your live site (not in edit mode)
- The widget should appear in the bottom right corner
- Test a conversation to make sure it works
Page-Specific Code Injection
Want the widget to appear only on certain pages?
Steps:
- Go to the Pages panel in your Squarespace dashboard
- Hover over the page where you want the widget
- Click the ⚙️ (gear icon)
- Click Advanced
- Scroll down to Page Header Code Injection
- Paste your widget embed code
- Click Save
Note: Use the Footer code injection for site-wide installation. Use page-level injection only if you want different widgets on different pages.
Customization Options
Change the Widget Title
<dem-agent name="default" title="Chat with us!"></dem-agent>
Use Different Prompts on Different Pages
If you've created multiple prompts in Demeterics (e.g., support, sales, checkout):
Site-wide footer (most common):
<dem-agent name="default" title="Need help?"></dem-agent>
Product pages (add to product page template):
<dem-agent name="sales" title="Product Questions?"></dem-agent>
Contact/Support pages (add to specific pages):
<dem-agent name="support" title="How can we help?"></dem-agent>
Start the Widget Open
<dem-agent name="default" title="Need help?" state="open"></dem-agent>
Embedded Widget (Inline on Page)
To place the widget inline (not floating), use a Code Block:
- Edit the page in Squarespace
- Click Add Block (+)
- Select Code (under "More" section)
- Choose HTML mode
- Paste this code:
<script src="https://demeterics.com/widget/embed.js?k=DEM-YOUR-KEY-HERE" async></script>
<dem-agent mode="embedded" name="default" title="Support Assistant"></dem-agent>
- Click Apply
The widget will now appear inline in your page content instead of floating.
Troubleshooting
Widget doesn't appear
Check these:
- Do you have a Business plan or higher? Personal plans don't support JavaScript in Code Injection.
- Did you add the code to the Footer section (not Header)?
- Is your widget key correct?
- Is your Squarespace domain added to Allowed Domains in your Demeterics widget settings?
- Clear your browser cache and hard refresh (Ctrl+Shift+R / Cmd+Shift+R)
Test in Preview mode: Squarespace allows you to preview changes before publishing. Use this to test the widget.
"Domain not allowed for this agent"
- Go to your Demeterics dashboard → AI Chat → Your Widget
- Add your Squarespace domain to Allowed Domains
- Built-in domain:
yoursite.squarespace.com - Custom domain:
yoursite.com - Add both if you use both
- Built-in domain:
- Save and refresh your website
Widget appears but doesn't work
If the widget shows but clicking it does nothing:
- Check browser console for errors (F12 → Console tab)
- Make sure you're on a Business plan or higher
- Verify the widget script loaded (F12 → Network tab → search for "embed.js")
Email us at support@demeterics.com if you still have issues.
Widget conflicts with Squarespace theme
Some Squarespace themes have CSS that may interfere with the widget positioning:
- Try adding this to your Custom CSS (Design → Custom CSS):
dem-agent {
z-index: 9999 !important;
}
- If that doesn't help, email support@demeterics.com with your site URL and theme name.
Performance issues or slow loading
If your site loads slowly after adding the widget:
- Make sure you added
asyncto the script tag (it should be there in our example) - Keep the code in the Footer section (not Header)
- Check if you have other heavy scripts loading - consider removing unused ones
Commerce-Specific Tips
If you run a Squarespace Commerce store, you can create specialized prompts for:
Product pages:
- Create a prompt named "product" with product information
- Add to product page templates or use page-specific injection
Checkout assistance:
- Create a prompt named "checkout" for order help
- Add to checkout pages (if supported by your theme)
General support:
- Use "default" prompt site-wide
- Include shipping, returns, and contact information
Need Help?
Email us: support@demeterics.com
We can help with:
- Verifying your Squarespace plan supports Code Injection
- Writing custom prompts for your store or business
- Advanced widget customization
- Troubleshooting CSS conflicts
- Commerce-specific chatbot configurations