Hi I have read the documentation tracking multiple subdomain but it seems not working on my site it does not do anything although I see apache access logs piwik is tracking but on piwik dashboard nothing is recorded.
I have main domain and 3 subdomain
www.example.com
imgs.example.com
events.example.com
profile.example.com
I have to track all of above domain in one piwik tracking script. I didn’t create any sub domain tracking script only on www.example.com
Below is script I have tried not working.
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://{$PIWIK_URL}/" : "http://{$PIWIK_URL}/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL, 1);
tracker.setCookieDomain('*.example.com'); // Same cookie as: example.com, www.example.com, subdomain.example.com, ...
tracker.setDomains('*.example.com'); // Download & Click tracking alias domains
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script>
<!-- End Piwik Code -->
Below script is currently running only for www.example.com.
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://{$PIWIK_URL}/" : "http://{$PIWIK_URL}/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL, + "piwik.php",1)
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script>
<!-- End Piwik Code -->
Please help do I need to create seperately tracking for each sub domain?