Webflow Integration Guide
Add the Demeterics AI Chat widget to your Webflow site using Custom Code.
Requirements
- A Webflow site on a paid Site plan (site-wide Custom code is not included in the free Starter Site plan)
- A Demeterics AI Chat widget (get your widget key from the AI Chat dashboard)
Important: Custom code does not run on the Designer canvas. Publish your site to your .webflow.io staging URL or your custom domain, then test there.
Method 1: Site Settings Custom Code (Recommended)
This method works site-wide and is the most reliable option.
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: Open Custom Code in Site Settings
- Log into your Webflow account and open your site
- Go to Site settings
- Click the Custom code tab
- You'll see two fields: Head code and Footer code
Step 3: Add the Widget Code
- Scroll down to the Footer code field
- 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 changes
Why Footer code?: Webflow injects the Footer code field just before the closing </body> tag, so your page content renders before the widget script is processed.
Note: Do not wrap the snippet in <html>, <head>, or <body> tags — Webflow will break your layout if you do.
Step 4: Publish Your Site
- Click Publish in the top right corner of the Designer
- Select your domains and publish
- Visit your live site to see the widget appear in the bottom right corner
Custom code changes only go live when you publish. Saving in Site settings is not enough.
Method 2: Page-Level Custom Code
Want the widget on only some pages, or a different agent per page?
Steps:
- Open the Pages panel in the Designer
- Hover over the page and click the gear icon to open its settings
- Scroll down to the Custom code section
- Paste your widget embed code into Code placed before the
</body>tag:
<script src="https://demeterics.com/widget/embed.js?k=DEM-YOUR-KEY-HERE" async></script>
<dem-agent name="support" title="How can we help?" state="minimized"></dem-agent>
- Replace
DEM-YOUR-KEY-HEREwith your actual key - Click Save and publish your site
Note: Page-level code loads after Site settings code. If you already added the widget site-wide, don't add the <script> tag again here — see "Widget appears multiple times" below.
Method 3: Code Embed Element (Inline on a Page)
To place the widget inside your page content instead of floating, use Webflow's Code Embed element.
Steps:
- Open the Add panel (the + icon in the left toolbar)
- Search for "Embed" and drag Code Embed onto your page
- 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>
- Replace
DEM-YOUR-KEY-HEREwith your actual key - Click Save & Close, then publish
Note: Code Embed only executes client-side HTML, CSS, and JavaScript, and it must not contain <html>, <head>, or <body> tags. Publishing still requires a paid Site plan.
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 your Demeterics dashboard:
Site-wide footer (most common):
<dem-agent name="default" title="Need help?"></dem-agent>
Product or pricing pages (page-level custom code):
<dem-agent name="sales" title="Product Questions?"></dem-agent>
Contact/Support pages (page-level custom code):
<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)
<dem-agent mode="embedded" name="support" title="Support Assistant"></dem-agent>
CMS Collection Pages
Custom code added to a Collection page template's page settings applies to every item in that Collection. This is the easiest way to give an entire blog, product catalog, or directory its own agent:
- In the Pages panel, open the Collection page template's settings
- Add your embed code to Code placed before the
</body>tag:
<dem-agent name="product" title="Product Questions?"></dem-agent>
- Save and publish
Create the product prompt in your Demeterics dashboard first.
Troubleshooting
Widget doesn't appear
Check these:
- Did you publish after saving your custom code? Saving alone does nothing on the live site.
- Are you looking at the published site rather than the Designer canvas? Custom code does not run on the canvas.
- Is your site on a paid Site plan? Site-wide custom code is not included in the free Starter Site plan.
- Is your widget key correct?
- Is your Webflow domain added to Allowed Domains in your Demeterics widget settings?
Test on staging first: Publish to your .webflow.io staging URL to check the widget before publishing to your custom domain.
"Domain not allowed for this agent"
- Go to your Demeterics dashboard → AI Chat → Your Widget
- Add your Webflow domain to Allowed Domains
- Staging domain:
yoursite.webflow.io - Custom domain:
yoursite.com - Add both if you publish to both
- Staging domain:
- Save and refresh your website
Widget works on staging but not on your custom domain
You published to .webflow.io but not to your custom domain. In the Designer, click Publish, tick both domains, and publish again. Then confirm the custom domain is in your Allowed Domains list.
Widget appears multiple times
You've added the embed code in more than one place. Check:
- Site settings → Custom code → Footer code
- Individual page settings → Custom code
- Any Code Embed elements on the page
Keep the <script src="...embed.js..."> tag in exactly one place. You can still have multiple <dem-agent> elements, but only one script tag per page.
Widget looks cut off or sits behind other elements
Webflow layouts with high z-index values on navbars or overlays can cover the widget. Add this to your Site settings → Custom code → Head code:
<style>
dem-agent { z-index: 9999 !important; }
</style>
If that doesn't help, email support@demeterics.com with your site URL.
Widget conflicts with Webflow Interactions
If a Webflow interaction hides or moves the widget, exclude the widget from the interaction's target selector, or move the embed code to a page where the interaction isn't running.
Need Help?
Email us: support@demeterics.com
We can help with:
- Verifying your Webflow Site plan supports custom code
- Choosing between site-wide, page-level, and Code Embed placement
- Setting up per-Collection agents for CMS and Ecommerce sites
- Writing custom prompts for your business
- Troubleshooting z-index and Interaction conflicts