Add Hazelchat to your HubSpot CMS site
What you need
- HubSpot Content Hub Starter, Professional or Enterprise, or Marketing Hub Professional or Enterprise. HubSpot’s help pages differ on free accounts, which may not show the setting.
- The Website settings permission in your HubSpot account.
- 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 HubSpot, click the settings icon in the top bar, then Content → Pages in the left sidebar.
- Under Choose a domain to edit its settings, pick Default settings for all domains. For one domain only, pick that domain and click Override default settings.
- Paste the line into Site Footer HTML and click Save.
- 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 HubSpot CMS’s own help (Use code snippets with HubSpot content and Add the Google Tag Manager code to HubSpot content), read on 14 October 2026. We have not yet tested Hazelchat on HubSpot CMS ourselves. If a menu looks different, HubSpot CMS’s page is the up-to-date one.
Check it works
- Open a published page in a private window, signed out of HubSpot.
- View the page source: HubSpot adds Site Footer HTML just before the end of each page.
HubSpot CMS’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
- Quotes. Footer HTML set for all domains also appears on HubSpot quote pages, so the chat shows there too. Set it for your website’s domain only if you don’t want that.
- Two chat buttons. If HubSpot’s own chat is on, both sit in the bottom-right corner. Move Hazelchat’s chat to the left under Website → Appearance in Hazelchat.
- A domain that overrides the defaults. Code in the default settings does not reach a domain with its own settings. Add the line there too.
- “The install script was not found on the page.” Check that you published the change in HubSpot CMS and that the line is complete, with your own key, then try again in Hazelchat.
Visitor consent
HubSpot’s cookie banner does not control scripts you add yourself: HubSpot says it cannot control cookies placed by third-party scripts. A developer can link the two with HubSpot’s cookie banner API and Hazelchat’s event below.
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
- In settings, open Content → Pages, delete the line from Site Footer HTML on every domain where you added it, and click Save.
- 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 HubSpot CMS itself, use the HubSpot Knowledge Base. For anything in Hazelchat, email hello@hazelchat.co. We answer within one business day. Other ways to install Hazelchat.