Tracking only works with one website with ID = 1, but not the other ones

I track 4 webpages. Onle the website with ID = 1 does work, the other three from ID 2 to 4 do not work. No error messages occure. As far as I overlook the situation, all adjustments are the same, of course, excluded the ID numbers in the tracking code. All tracked web pages have been added to the trusted hostname list. The tracking code is implemented in all webpages - all checked and tested. I have no ideas any more, where the failure could lie. Thanks for any hints.

How do you track? (JavaScript, MTM, server log, server-side tracking, etc.?)
When tracked, do you see errors in browser console? In the network console of your browser? In the server errors log file?

I track with script. The script is the following:

<!-- Matomo -->
<script>
  var _paq = window._paq = window._paq || [];
  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="https://my-matomo/tracking/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '3']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Matomo Code -->

It is automatically inserted by the Itcs Matomo plugin for Joomla4. This applies for all four pages, including the one, where it works (ID = 1). The html code above is the original code from the web generated by the URL: https://www.globephysics.com/. It has the ID = 3, which i. e. does not work.
There are no error codes or warnings at all, either at the browsers nor at the matomo server error log.

Picture removed for privacy reasons.

Meanwhile, I think I got the solution. I need to add all domain names, as www.* to the the trusted Matomo hostname list. Without that step it does not work.

1 Like