piwikTracker.disableCookies(); not working


#1

Hi,

I had some problems disabling the cookie of Piwik. In the end I switched from using piwik.js to /js/index.php, which solved the problem. Maybe this is something the Piwik-team should look into?

Code that was not working:


<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://analytics.yyy.nl/piwik/" : "http://analytics.yyy.nl/piwik/");
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.disableCookies();
piwikTracker.trackPageView();
  piwikTracker.enableLinkTracking();
} catch( err ) {}

</script><noscript><p><img src="http://analytics.yyy.nl/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>

Code that works:


<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://analytics.yyy.nl/piwik/" : "http://analytics.yyy.nl/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "js/' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
  var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
  piwikTracker.disableCookies();
piwikTracker.trackPageView();
  piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://analytics.yyy.nl/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>