The Piwik dashboard doesn’t need to know where piwik.js is, so you’re free to minify/combine it with other scripts if you want to try to improve the page load times on the pages you want to track.
[quote=vipsoft @ May 25 2010, 04:07 PM]It depends on the rest of your tracking code. If you remove that snippet, make sure any code that follows doesn’t depend on pkBaseURL being defined.
– Anthon[/quote]
Thanks again Anthon but I do need an example since each try disable tracking.
The Piwiks script in my template file is the common one:
<!-- Piwik -->
<script>
var pkBaseURL = (("https:" == document.location.protocol) ? "https://mysite.com/piwik/" : "http://mysite.com/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script>
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://mysite.com/piwik/piwik.php?idsite=1" style="border:0" alt="outil de statistiques du blog en HTML5"/></p></noscript>
<!-- End Piwik Tag -->
If I remove the 1st script and add the piwik.js in the combined path as above it fails. style_emoticons/<#EMO_DIR#>/mellow.gif
My point is that you can’t simply remove the first block entirely, otherwise pkBaseURL is no longer defined – which would cause the next block to fail.
Perhaps you could use thiis after your minifier has loaded piwik.js?
You were right Anthon.
The issue was in fact due to the place of the Piwik js script and the combined scripts link. It works when located at the end.
Thanks a lot and have a nice day.