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?