Page 1 of 1

Fix for Dutch site Marktplaats.nl / Google Analytics

Posted: Sun Apr 10, 2016 10:25 pm
by noscriptsplox
Marktplaats is a pretty popular site, so here is the fix for the noscript.surrogate.ga.replacement surrogate.

Site does this:

Code: Select all

var visitCode=_gat._getTrackerByName()._visitCode();if(visitCode){...


So we need to change surrogate to this:

Code: Select all

(function(){var _0=$S(function()_0),_u=function(){};_0.__noSuchMethod__=_0;('ga'in window)||(ga=_u);window.urchinTracker=window._u||_u;window._gaq=$S({__noSuchMethod__:_0,push:function(f){if(typeof f=='function')f();else if(f&&f.shift&&f[0]in this)this[f.shift()].apply(this,f)},_set:function(a,b){if(typeof b=='function')b()},_link:function(h){if(h)location.href=h},_linkByPost:function(f){if(f&&f.submit)f.submit();return true},_getLinkerUrl:function(u){return u},_trackEvent:_0});window._gat=$S({__noSuchMethod__:function(){return _gaq},_getTrackerByName:function(){return {_visitCode:function(){return 0}}}})})()


Cheers

Re: Fix for Dutch site Marktplaats.nl / Google Analytics

Posted: Sun Apr 10, 2016 10:28 pm
by barbaz
Thank you for your contribution! 8-) I will make sure Giorgio sees this.

Re: Fix for Dutch site Marktplaats.nl / Google Analytics

Posted: Mon Apr 11, 2016 9:52 pm
by barbaz
For those who want to visit the site mentioned in the OP, should probably read this first: http://arstechnica.com/security/2016/04/more-big-name-sites-hit-by-rash-of-malicious-ads-that-attack-end-users/

Re: Fix for Dutch site Marktplaats.nl / Google Analytics

Posted: Fri Apr 22, 2016 5:10 am
by Giorgio Maone
It's gonna be included in next release, thank you.