<Title> & 404 Tracking, Good Or Not Good?


#1

Hello,

This may sound like a silly question from my part but are there any issues in using twice
piwikTracker.setDocumentTitle code, one for and one for 404 trackings? I am
of course using the latest version of Piwik. The tracking code I have is below. Thanks.

Kind Regards,
Axl Jay Angel


     <script type="text/javascript">
          var pkBaseURL = (("https:" == document.location.protocol) ? "URL" : "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.setDocumentTitle(document.title);
          piwikTracker.setDocumentTitle('404/URL = '+String(document.location.pathname+document.location.search).replace(/\//g,"%2f") + '/From = ' + String(document.referrer).replace(/\//g,"%2f"));
          piwikTracker.trackPageView();
          piwikTracker.enableLinkTracking();
          } catch( err ) {}
     </script>
     <noscript>
          <p><img src="URL" style="border:0" alt="" /></p>
     </noscript>


(Matthieu Aubry) #2

only the second call will be used


#3

Oh, ok. In that case, I shall remove the first call then in order to keep the code clean & neat. Thank you for your help.