Skip to content

Instantly share code, notes, and snippets.

@miketaylr
Forked from paulirish/utmstrip.user.js
Created October 14, 2010 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miketaylr/626991 to your computer and use it in GitHub Desktop.
Save miketaylr/626991 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http://*
// ==/UserScript==
// save this as utmstrip.user.js and drag it into Chrome or Firebug (with greasemonkey)
if (/^\?utm_/.test(location.search) && window.history.replaceState){
window.history.replaceState({},'', location.href.replace(/\?utm_.*/,''));
}
// also..
// this is just as useful on your own site.. in case you have feedburner tracking or whatever.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment