Joomla
Integrate Rybbit Analytics with your Joomla website
Joomla is a popular open-source content management system. Here's how to add Rybbit Analytics to your Joomla site.
How to Add Rybbit to Joomla
Using a Custom HTML Module
This is the easiest method and doesn't require editing any files.
Create a New Module
- Log in to your Joomla Administrator panel
- Go to Extensions > Modules
- Click New and select Custom
Configure the Module
Set the following options:
- Title: Rybbit Analytics (or any name you prefer)
- Show Title: No
- Position: Select a position that appears in the
<head>section, often calledhead,debug, or similar depending on your template
In the Editor tab, switch to Code view (or disable the editor) and paste:
<script>
(function() {
var s = document.createElement('script');
s.src = 'https://app.rybbit.io/api/script.js';
s.defer = true;
s.setAttribute('data-site-id', 'YOUR_SITE_ID');
document.head.appendChild(s);
})();
</script>Replace YOUR_SITE_ID with your actual Site ID.
Publish the Module
- Set Status to Published
- Under Menu Assignment, select On all pages
- Click Save & Close
If your template doesn't have a head position, you can use any position - the JavaScript will still add the script to the document head.
Editing Template Files
For more control, you can add the script directly to your template.
Create a child template or template override to avoid losing changes when the template updates.
Access Template Files
- Go to System > Site Templates
- Click on your active template
- Click on the index.php file (or create an override)
Add the Script
Find the closing </head> tag and add the script just before it:
<script>
(function() {
var s = document.createElement('script');
s.src = 'https://app.rybbit.io/api/script.js';
s.defer = true;
s.setAttribute('data-site-id', 'YOUR_SITE_ID');
document.head.appendChild(s);
})();
</script>
</head>Replace YOUR_SITE_ID with your actual Site ID.
Save the File
Click Save or Save & Close to apply the changes.
Troubleshooting
Script not appearing on the site
- Check that the module is published and assigned to all pages
- Clear Joomla's cache: System > Clear Cache
- Verify the module position exists in your template
Editor stripping the script
Joomla's default editor (TinyMCE) may strip script tags. To fix this:
- Go to Extensions > Plugins
- Find and open Editor - TinyMCE
- Under Extended Valid Elements, add:
script[src|defer|data-site-id] - Or simply use the Code view when editing the module
Caching issues
If you're using a caching plugin or extension:
- Clear all caches after adding the script
- The script should work with page caching since it loads client-side