Joomla
Add Rybbit analytics to your Joomla site
Joomla has no built-in head-code setting, so the snippet goes in either a Custom module assigned to every page or in your template's index.php.
Get your tracking snippet
In your Rybbit dashboard, open Site Settings → Tracking Script and copy your snippet. It looks like this:
<script src="https://app.rybbit.io/api/script.js?siteId=YOUR_SITE_ID" defer></script>YOUR_SITE_ID is the numeric ID of your site. If you self-host Rybbit, app.rybbit.io is the domain of your own instance.
Add the snippet to Joomla
No file edits are needed, and the module survives template updates.
-
In the Administrator panel go to Content → Site Modules (Extensions → Modules on Joomla 3), click New and choose Custom.
-
Set Title to
Rybbit, Show Title to Hide, and Position to any position your template renders on every page. Templates rarely expose a<head>position; the loader below moves the script into the head from wherever the module is rendered. -
In the editor, use the Toggle Editor button (or Code view) so the script is not stripped, then paste:
<script> (function () { var s = document.createElement("script"); s.src = "https://app.rybbit.io/api/script.js?siteId=YOUR_SITE_ID"; s.defer = true; document.head.appendChild(s); })(); </script> -
Set Status to Published, choose On all pages under Menu Assignment, and click Save & Close.
Edit a child template (Joomla 4.1+) or your own copy of the template, otherwise the change is lost on the next template update.
-
Go to System → Site Templates and open your active template.
-
Open
index.phpand add the snippet just before</head>:<script src="https://app.rybbit.io/api/script.js?siteId=YOUR_SITE_ID" defer></script> </head> -
Click Save & Close.
Verify installation
Open your live site in a new tab and click through a few pages. Within a few seconds the pageviews appear in the Rybbit dashboard.
If nothing shows up:
- View the page source and search for
script.js?siteId=to confirm the snippet is on the page. - Open the browser Network tab and check that
script.jsreturns200and thatPOSTrequests go to/api/track. - Disable ad blockers, or set up a proxy so the script loads from your own domain.
- See the script troubleshooting guide for other common causes.
Troubleshooting
- Module not on the page: confirm it is published, assigned to On all pages, and that the chosen position exists in your template. Then clear the cache under System → Clear Cache.
- TinyMCE strips the script: open the Editor - TinyMCE plugin under System → Plugins (Extensions → Plugins on Joomla 3) and add
script[src|defer]to Extended Valid Elements, or keep using the toggled-off editor when saving the module. - Page caching: the System - Page Cache plugin serves cached HTML, so clear the cache after adding the snippet. The script itself loads client-side and works with cached pages.
Next steps
- Track custom events such as signups, purchases and button clicks.
- Identify users to connect sessions to accounts.
- Proxy the script through your own domain to bypass ad blockers.
- Script attributes let you skip or mask URLs and tag events.