Old Piwik Tracking Code Need new Tracking Code

We have an intranet that used Piwik before you went to Matomo. The code below is what was in our WP theme but it no longer works. Someone suggested I need updated code. Can you help with this? I really do’t like the Google Analytics that they put on my site. Thanks

<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://intranet.kki.org/school/piwik/" : "http://intranet.kki.org/school/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", 3);
} catch( err ) {}
</script><noscript><p><img src="http://intranet.kki.org/school/piwik/piwik.php?idsite=3" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->

Debra P.


I have a hard time understanding your tracking code as there are many modifications. I’d recommend you to stay with the default tracking code unless there is a very good reason not to.

<!-- Matomo -->
<script type="text/javascript">
  var _paq = _paq || [];
  (function() {
    var u="https://intranet.kki.org/school/piwik/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
<!-- End Matomo Code -->