Ghostery + <noscript> image tracker how to make it work?


(mahdi1234) #1

Hi there,

I’ve noticed that browser extensions like Ghostery (and NoScript most likely as well) completely ignore part, thus visit is not counted via image tracker neither. Is there a way around this?

PS - I made sure it was blocking it by simply using img tracking without and with tag, whereas it worked with former however no visit was tracked for the latter one.

PS II - I don’t mind using php tracking, but definitely want to avoid duplicate entries, so it would require some logic to call php only for visitors without js or with some blocking add-on, anyone has experience with this?

thanks & cheers


(Matthieu Aubry) #2

Currently it’s not possible to track users who disabled piwik.js and don’t execute noscript. However, you can import the Server logs in Piwik in a different website. You will then have one website built from the JS and one built from the logs and you can then compare.


(mahdi1234) #3

I’ve solved this thanks to this post http://forum.piwik.org/read.php?3,88128,page=1#msg-88149

In particular this code shall be added to the exception part of the tracking code -


catch( err ) {
  window.piwikerr=err;
  (function() {
    var img = document.createElement('img');
    img.src = 'http://piwik_server/piwik.php?idsite=X&rec=1';
    document.body.appendChild(img);
  })();
}


(vipsoft) #4

How does “window.piwikerr = err” help?


(mahdi1234) #5

Sorry, that line shouldn’t be there, so here goes the code -


catch( err ) {
  (function() {
    var img = document.createElement('img');
    img.src = 'http://piwik_server/piwik.php?idsite=X&rec=1';
    document.body.appendChild(img);
  })();
}