Two different javascript codes- not tracking visitors


#1

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 ?


#3

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) ? "https://www.pcnett.net/piwik/" : "http://www.pcnett.net/piwik/"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); 
 piwikTracker.setRequestMethod('POST'); 
 piwikTracker.trackPageView(); 
 piwikTracker.enableLinkTracking(); 
 } catch( err ) {} 
 </script><noscript><p><img src="http://www.pcnett.net/piwik/piwik.php?idsite=3" 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 || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://www.pcnett.net/piwik/";
    _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);
  })();
</script>
<noscript><p><img src="http://www.pcnett.net/piwik/piwik.php?idsite=3" 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:


piwikTracker.setRequestMethod('POST');

So try to put it in your new code before trackPageView


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


#5

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 . . .