Tracking code "manipulation" ok


(Marbot) #1

The provided tracking code includes ’ like e.g.


<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://piwik.example.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>
<noscript><p><img src="http://piwik.example.net/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->

This however breaks my website - do not ask why. Will it be possible to replace ’ by " without worries, so I get


<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);
  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://piwik.example.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>
<noscript><p><img src="http://piwik.example.net/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->

or in short e.g. changing


  _paq.push(['trackPageView']);

to


  _paq.push(["trackPageView"]);

etc.

Will this changed tracking code still track. I tried to Google on how to verify if piwik tracking code is actually working but got everything but what I wanted to know. So this is why I am explicitly asking here.

Cheers

Edit: ??? I am not sure why this ended up in the German language forum. This is unintentional. :frowning: