Two different javascript codes- not tracking visitors


hi. . anyone - -
recently my piwik stopped working on hostgator for all my accounts except one
this old javascsript is working on the 1 website :


this newer script on all the rest is not :


any ideas why only the old one is working ?
should I just change all the rest to the old script code?

(Matthieu Aubry) #2

The new code should work. Can you try 2.0-beta and copy the latest JS code and try again ?

if still not working, do you see any javascript error in the console ?


hi anyone
im now looking to follow up on my issue
the problem above still exists for me on all my accounts at hostgator. . .
the problem is that the old tracking code from a old version of piwik works
this tracking code WORKS

<!-- Piwik --> 
 <script type="text/javascript"> 
 var pkBaseURL = (("https:" == document.location.protocol) ? "" : ""winking smiley; 
 document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"winking smiley); 
 </script><script type="text/javascript"> 
 try { 
 var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 3); 
 } catch( err ) {} 
 </script><noscript><p><img src="" style="border:0" alt="" /></p></noscript> 
 <!-- End Piwik Tracking Code -->

this new tracking code DOES NOT WORK

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

im using the old tracking code and all works , im just not sure how long that old code will work for
this happens to anyone ? cant be just me

(Matthieu Aubry) #4

in your old code you have:


So try to put it in your new code before trackPageView

_paq.push(['setRequestMethod', 'POST']); 


Ok I now got chance to test . . .

THIS WORKS . . . . yippee

– now I can use the new code – I just have to insert the line you gave me

am I the only one this is happening too ?

thanks thanks . . .