How to add a custom AI chatbot to your Joomla website
· 7 min read
Joomla still runs a great many club, association and small business sites, and adding an AI chat assistant to one doesn't need an extension. Most AI chat assistants, ours included, are added with a single line of code, a script tag, and Joomla gives you a few places to put it.
This guide uses Pixexl's assistant as the example, but the steps are the same for most chat tools that give you a script tag.
Before you start
You'll need three things:
- An administrator account for the site's back end.
- Your chat's embed code. In Pixexl, it's on your project's Settings tab, under the integration code. It looks something like this:
<script
src="https://…/pixe-widget.js"
data-project-id="your-project-id"
data-api="https://…"
async
></script>
- Your domain added to the project. For security, the chat only runs on domains you've allowed. If the site also runs on a staging address, add that too.
It's also worth giving the assistant something to answer from first: add your site's pages as its knowledge (see What to give your AI assistant so it answers well).
Option 1: a Custom module (easiest)
A Custom module holds any HTML and shows it in a template position. Placed on every page, it loads the chat everywhere.
- Turn off the editor for yourself first. Joomla's TinyMCE removes
<script>tags. Go to your user menu, Edit Account → Basic Settings, set Editor to Editor - None (or CodeMirror) and save. - Go to Content → Site Modules → New and choose Custom.
- Give it a title like "Pixe chat", and set Show Title to Hide.
- Paste your embed code into the content box.
- Choose a Position that's on every page, ideally one near the end of the page such as footer (in Cassiopeia, Joomla's default template) or debug.
- On the Menu Assignment tab, choose On all pages.
- Save, and set your editor back to TinyMCE if you like.
The module shows nothing itself; the chat appears as its own button in the corner. Open your site in a new tab to check.
Option 2: your template's custom code field
Many commercial templates and frameworks (Helix, Astroid, T4, Gantry) have a Custom Code setting with a "before </body>" box. If yours does, it's the tidiest place: go to System → Site Template Styles, open your template's style, find the custom code tab and paste the embed code into the box for the end of the body. Save.
Option 3: a child template (for developers)
If you look after the template yourself, add the code to its index.php, just before </body>. Do it in a child template (Joomla 4.1 and later: System → Site Templates, open the template, Create Child Template), so an update to the parent template doesn't wipe your change. Make the child template's style the default.
Will it clash with my template?
It shouldn't. The chat draws itself in its own sealed-off area of the page, so your template's styles can't change how it looks, and its styles can't leak into your site. Its colours, greeting and position come from the Widget tab in your Pixexl dashboard, so you can change them later without touching Joomla again.
Cookie consent
The chat remembers a visitor's conversation in their browser, so it's covered by your cookie rules. Either keep the chat's own cookie notice (on by default, linked to your privacy policy from the Widget tab), or, if you run a consent extension, turn the chat's notice off, add data-consent="pending" to the script tag and have your consent tool call PixeWidget.grantConsent() when the visitor agrees. Pick one, not both.
It's not showing up: what to check
- The script was stripped. Open the module again: if the code is gone or turned into text, the editor removed it. Use Editor - None, as in step 1.
- The module isn't on every page. Check its Menu Assignment is On all pages and its position exists in your template (Preview in Site Template Styles shows the positions).
- The module is unpublished, or its access is set to Registered instead of Public.
- Caching. Clear Joomla's cache (System → Clear Cache) and any page cache extension or CDN.
- The domain. A staging address needs to be in the project's allowed domains.
- The chat is switched off. Check that "Show the chat on my site" is on in the Widget tab.
If it still won't appear, open your browser's developer console (right-click, Inspect, then Console). The chat leaves a short message there explaining why it didn't load.
After it's live
Ask it the questions your visitors ask, read the real conversations once a week, and add forms so a question can turn into a booking or an enquiry without leaving the chat (see How to turn website chats into bookings and enquiries).
Every Pixexl plan includes the assistant, and your first 2 weeks are free, so you can try it on your Joomla site with real visitors before you decide. Meet Pixe AI to see what it can do.
Joomla chatbot questions
Do I need a Joomla chatbot extension?
No. The chat is one script tag, so a Custom module, your template's custom code field or a child template is all it takes. Nothing is added to your database apart from the module.
Why did my Custom module remove the script?
Joomla's editor, TinyMCE, strips <script> tags by default. Switch your own editor to Editor - None (or CodeMirror) in your profile before you create the module, and paste the code into the plain text box.
Does it work on Joomla 4, 5 and 6?
Yes. The Custom module and child template options work the same on Joomla 4 and later. Joomla 3 has Custom modules too, though it's no longer supported and worth upgrading.
Will it slow down my site?
Not noticeably. The script loads with async, so the browser fetches it without holding up the rest of your page.
Is there a free trial?
Yes. Every Pixexl plan includes the AI chat assistant, and your first 2 weeks are free, so you can try it on your Joomla site with real visitors. See pricing for the plans.