Add an AI chat agent to your Contao website
Hazelchat answers your visitors from the pages and documents you approved, shows the sources under every answer and passes enquiries on to you. A free extension from the Contao Manager adds it to every page of your website: no template editing.
Version 1.0.0 for Contao 5.3, 5.7 and 6.0. The Free plan includes 50 answers a month on one website, with no card, and stays free.
Works with Contao 5.3 LTS, 5.7 LTS and 6.0, with classic and Twig page layouts, installed from the Contao Manager or with Composer.
What you need
- Contao 5.3 or 5.7 (both long-term support versions) or 6.0, with PHP 8.1 or later. Contao 4.13 is not supported.
- Access to the Contao Manager (or Composer) and a back-end account that can edit the website root. If your agency looks after the site, send them the steps.
- A Hazelchat account. The extension needs the hosted Hazelchat service; the Free plan includes 50 answers a month on one website, with no card.
Add Hazelchat to Contao in five steps
-
In Hazelchat
Prepare your agent
Add your content, check the details and try your agent. Under Website → Install on your website, add your website's domain.
-
In Hazelchat
Copy the installation code
Copy the installation code. It holds your public widget key, which is not a password.
-
In Contao
Install the extension
In the Contao Manager, search for Hazelchat, add it and apply the changes; the Manager also updates the database. With Composer, run
composer require hazelchat/contao-hazelchatand thenvendor/bin/contao-console contao:migrate. Installing it alone loads nothing on your site. -
In Contao
Paste the code into your website root
In the back end, open Site structure and edit your website root (the globe). Under Hazelchat, paste the code into Installation code and save. With one root per language on the same domain, one root is enough. If you pasted a Hazelchat script into a page layout before, remove it so the chat loads once.
-
On your site
Switch it on and test it
Back in Hazelchat, click Publish and switch on (or Switch on if your published agent is unchanged). Hazelchat checks that the script is on your website before the agent goes live. Then open your website, ask a question in the chat, return to Hazelchat and click Yes, I saw this answer.
Send this to your agency
No access to the Contao Manager? Copy this message, put your installation code where it says so, and send it to whoever looks after your site.
Please add the Hazelchat chat to our Contao website:
1. Install "Hazelchat" in the Contao Manager
(or: composer require hazelchat/contao-hazelchat, then contao:migrate).
2. Site structure: edit our website root and, under Hazelchat,
paste this into "Installation code":
[our installation code from Hazelchat]
3. If we use Contao Cookiebar: add a cookie of the type "Hazelchat"
to a group of our banner.
Guide: https://hazelchat.co/integrations/contao/
What the extension does
It adds one script to the pages of your website and nothing else. Your content, answers, enquiries and billing all stay in your Hazelchat workspace.
The extension adds https://app.hazelchat.co/widget.js, with your public key, just before </body> on every page below a website root that has the code, with classic and Twig page layouts. It stores only the key, so anything that is not a Hazelchat installation code is refused when you save. Other domains in the same Contao installation use their own code. It adds two fields to the website root and no tables, and sends nothing from Contao to Hazelchat; the back end never loads the chat. If the website root's Content-Security-Policy is on, the extension allows https://app.hazelchat.co for the chat. Its settings are in English and German, and it is free software under the LGPL, version 3 or later.
Cookie banners
Contao has no cookie banner of its own. With Contao Cookiebar (Oveleon), add a cookie to a group of your banner, for example a functional one, and choose the type Hazelchat. The chat then starts only after the visitor agrees in the banner, on every page, and stops when they decline. There is no script to paste and nothing else to switch on.
With another consent tool, turn on Wait for my cookie banner in the website root. The chat then stays closed and sends no chat requests until your tool sends this line once the visitor agrees:
window.dispatchEvent(new CustomEvent('hazelchat-consent', { detail: true }));
Send detail: false when a visitor withdraws consent. Usercentrics, CCM19, consentmanager and several other tools work with a service named Hazelchat; cookie banners says what to do in each. If your site must block even the script download, let your consent tool block that script too.
If the chat does not appear
Is the code in the website root?
The code goes into the website root (the globe in the site structure), not into a normal page.
Was the code refused?
Paste the whole installation code, or only its 64-character key. Anything else, such as an API key, is refused when you save.
Did the visitor agree?
With a Hazelchat cookie in Contao Cookiebar, or with the wait for your cookie banner on, the chat appears only after consent.
Leave the script alone
Exclude
https://app.hazelchat.co/widget.jsfrom script combining, rewriting or delayed loading. The script must keep its own address and key.Content-Security-Policy
If your server or a proxy sends its own policy, allow
https://app.hazelchat.coinscript-src,connect-srcandframe-srcthere.A second domain
The Free plan serves one website. A second domain needs a plan with more websites.
Change or remove
New widget key
If you rotate the key in Hazelchat, paste the new code into the website root and save.
Pause the chat
Switch Hazelchat off in your workspace. It stops answering straight away, even on cached pages.
Remove it from the site
Empty Installation code in the website root and save, or remove the extension in the Contao Manager (composer remove hazelchat/contao-hazelchat). Your Hazelchat account and plan are not affected.
Updates and changes
The Contao Manager shows new versions with your other updates; with Composer, run composer update hazelchat/contao-hazelchat.
1.0.0 (21 October 2026): adds the Hazelchat chat to every page below a website root from one installation code; a "Hazelchat" cookie type for Contao Cookiebar; optional wait for any other cookie banner; English and German settings.
Contao is a registered trademark of the Contao Association. Hazelchat is not affiliated with or endorsed by the Contao Association; the name is used here only to say which software the extension works with.
Let your Contao website answer from its own pages.
Questions? Email hello@hazelchat.co. We answer within one business day. Not on Contao? See all the ways to install Hazelchat.