Multiple visitor profiles for same IP across sub-domains

Not sure if it’s a bug or by design. I have Piwik tracking our main domain (www) and a sub-domain (edu). I noticed that Piwiki treats same IP/visitor as separate visitor - creating separate profile for them when they visit main site and sub-domain. See screenshot.


<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["setCookieDomain", "*.domain.net"]);
  _paq.push(["setDomains", ["*.domain.net"]]);
  _paq.push(['setDocumentTitle', "WWW: " + document.title]);
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://analytics.domain.net/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', 1]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
    g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
  })();
</script>

Following instructions, I think I did set it up correctly to enable sub-domain tracking.

Is this an issue or by design?

Yes it is by design. Though it can be possible to use User ID to set a user id Accurate User Detection cross devices: User ID (set in JS and all other clients) · Issue #3490 · matomo-org/matomo · GitHub (coming next release)

piwik tracks unique visitors by default using first party cookie that are unique for each sub domain

This is great, thanks Matt. Looking forward to the new version and testing this.