Fix for Dutch site Marktplaats.nl / Google Analytics

Proposals for new surrogate scripts, updates/bug fixes to existing ones, tips and tricks to work around the lazy web.
Post Reply
noscriptsplox
Posts: 1
Joined: Sun Apr 10, 2016 10:19 pm

Fix for Dutch site Marktplaats.nl / Google Analytics

Post by noscriptsplox » Sun Apr 10, 2016 10:25 pm

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
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0

barbaz
Senior Member
Posts: 9232
Joined: Sat Aug 03, 2013 5:45 pm

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

Post by barbaz » Sun Apr 10, 2016 10:28 pm

Thank you for your contribution! 8-) I will make sure Giorgio sees this.
*Always* check the changelogs BEFORE updating that important software!
-

barbaz
Senior Member
Posts: 9232
Joined: Sat Aug 03, 2013 5:45 pm

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

Post by barbaz » Mon Apr 11, 2016 9:52 pm

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/
*Always* check the changelogs BEFORE updating that important software!
-

User avatar
Giorgio Maone
Site Admin
Posts: 8716
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

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

Post by Giorgio Maone » Fri Apr 22, 2016 5:10 am

It's gonna be included in next release, thank you.
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0

Post Reply