Add Hazelchat to your Duda site
What you need
- A Duda site on a Team plan or higher. Duda offers its custom code fields from Team upwards.
- Access to the site’s settings. If your designer gave you a login without settings, send them this page.
- A Hazelchat account with an agent you have tried in the workspace. You can start free.
Add the code
- In Hazelchat, open the install step (Install in setup, or Website → Install on your website), choose Something else and click Copy the code. It is one line with your own widget key:
<script src="https://app.hazelchat.co/widget.js" data-agent="YOUR-WIDGET-KEY" defer></script> - In the Duda editor, click More in the side panel, then Settings.
- Open Header HTML (Duda’s help also calls it Head HTML) and paste the line into Body End HTML. Duda adds it just before the end of every page.
- Save, then publish your site.
- Back in Hazelchat, enter your website’s address and click I’ve added the code.
- Click Publish and switch on (or Switch on if your agent is already published). Hazelchat first looks for the code on your website and only then makes the chat visible.
- Open your website, refresh it, ask the chat a question a visitor would ask, then return to Hazelchat and click Yes, I saw this answer.
These steps follow Duda’s own help (Custom Code and Privacy Settings), read on 14 October 2026. We have not yet tested Hazelchat on Duda ourselves. If a menu looks different, Duda’s page is the up-to-date one.
Check it works
- Open the published site, not the editor: the editor shows your site inside a frame.
- View the page source and search for
app.hazelchat.co/widget.jsnear the end of the page.
Duda’s help says this code goes into the page itself, so Hazelchat’s check can find it when you switch the chat on. If your home page does not carry the code, enter the page that does under Installation troubleshooting → Page the script is on.
Common problems
- The line disappears from the head field. Duda’s head field accepts only link, script and meta tags and removes anything it considers incorrect. Body End HTML is the right place for Hazelchat.
- Page speed optimisation. Duda says its page speed optimisation can interfere with custom code, and its support can switch it off for a site.
- Cookie tracking switched off. If Enable cookie tracking on this site is off under Privacy Settings, Duda stops tracking code you added. Duda does not say whether that includes a chat, so check this switch if the chat never appears.
- “The install script was not found on the page.” Check that you published the change in Duda and that the line is complete, with your own key, then try again in Hazelchat.
Visitor consent
Duda’s cookie notice (Settings → Privacy Settings) informs visitors but does not ask for consent or hold code back. Duda says consent apps cannot stop code in the head from running before consent, and recommends Body End HTML for such code.
To keep the chat closed until a visitor agrees, add data-require-consent="true" to the line, before defer. The chat then waits until your consent tool sends:
window.dispatchEvent(new CustomEvent('hazelchat-consent', { detail: true }));
Send detail: false when a visitor withdraws consent. With this option and no event, no chat appears, so test it on your published site.
Remove Hazelchat
- Open Settings → Header HTML, delete the line from Body End HTML, save and publish.
- To hide the chat everywhere at once without touching your site, switch Hazelchat off on its Website page. The line then stays on your pages but shows nothing.
Help
For Duda itself, use the Duda Help Center or your web designer. For anything in Hazelchat, email hello@hazelchat.co. We answer within one business day. Other ways to install Hazelchat.