OnyxMetric
Integration Guides

Joomla

Step-by-step guide to add OnyxMetric cookieless analytics to your Joomla site and start tracking visitors

Joomla has no built-in head-code setting. Add the tag with a Custom module shown on every page, or put it in your template's index.php.

Copy your tracking snippet

In OnyxMetric, open your site's Site Settings and copy the tracking script. It looks like this:

<script src="https://app.onyxmetric.com/api/script.js?siteId=YOUR_SITE_ID" async></script>

YOUR_SITE_ID is the numeric ID of your site.

Add the snippet to Joomla

No file edits, and the module survives template updates.

  1. In the Administrator panel go to Content → Site Modules (Extensions → Modules on Joomla 3), click New, and choose Custom.

  2. Set Title to OnyxMetric, Show Title to Hide, and Position to any position your template renders on every page.

  3. In the editor, switch to code view (Toggle Editor) so the script is not stripped, then paste:

    <script>
    (function () {
      var s = document.createElement("script");
      s.src = "https://app.onyxmetric.com/api/script.js?siteId=YOUR_SITE_ID";
      s.async = true;
      document.head.appendChild(s);
    })();
    </script>
  4. 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. Changes to a stock template are lost on its next update.

  1. Go to System → Site Templates and open the active template.

  2. Open index.php and add the tag just before </head>:

    <script src="https://app.onyxmetric.com/api/script.js?siteId=YOUR_SITE_ID" async></script>
    </head>
  3. Click Save & Close.

Check that it works

Load your live site and click through a few pages. Pageviews show up in the OnyxMetric dashboard within seconds.

If nothing arrives:

  • View the page source and search for script.js?siteId= to confirm the tag is present.
  • In the browser's Network tab, check that script.js returns 200 and that requests go to /api/track.
  • Turn off ad blockers, or proxy the script through your own domain.
  • Read script troubleshooting for other 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.
  • The editor strips the script: open the TinyMCE plugin settings under System → Plugins and allow script elements with a src attribute in the valid elements list, or switch the editor to None.
  • Page cache: the System - Page Cache plugin serves stored HTML, so clear the cache after adding the snippet.

Next steps

On this page