Created
September 14, 2010 03:39
-
-
Save markhepburn/578492 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Clean up all those invasive and ugly utm_ parameters, so you can paste a url. | |
// (will reload the page, be warned) | |
(function(){ | |
var qs = window.location.search.slice(1).split('&'), | |
newqs = []; | |
for (var i = 0; i < qs.length; i++) { | |
if (qs[i].slice(0,4)!='utm_') { | |
newqs.push(qs[i]); | |
} | |
} | |
window.location.search = (newqs.length ? '?' : '') + newqs.join('&'); | |
})(); | |
// as a bookmarklet: | |
// javascript:(function(){var qs=window.location.search.slice(1).split('&'),newqs=[];for(var i=0;i<qs.length;i++){if(qs[i].slice(0,4)!='utm_'){newqs.push(qs[i]);}}window.location.search=(newqs.length?'?':'')+newqs.join('&');})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment