Please help why subdomains are not tracking?


I’m trying to track subdomains like and

I have tried so many permutations. The only thing that works if I explicitly add every subdomain under Websites > Manage > URLs.

Preference is for Matomo to track every subdomain where we have the tracking script without having to add every subdomain explicitly.

Current setup which is NOT working has this setting under Websites > Manage > URLs

The tracking script is…

  var _paq = window._paq = window._paq || [];
  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  _paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
  _paq.push(["tracker.setCookieDomain", "*"]);
  _paq.push(["setDomains", ["*.*","*.*.*","*"]]);
  (function() {
    var u="";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '1']);

What am I doing wrong?

Hi there,

The tracking code you have in place looks correct.
As long as the sub-domains you are wanting to track have the tracking code in place, these will be tracked into your Matomo Instance.

I have located a support case that you have sent us, which we have also replied too.
If you are able to respond to that support email, with the sub-domains that are not tracking, we can advise from there.

@goochj03 I replied 2 days ago via email.

Can you please see what the issue is? Just making sure it’s not sitting in spam.

Thank you,