Created
August 19, 2016 22:29
-
-
Save rniswonger/3d740e54b14f53dd154a27fb9537ed28 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
// Wes Bos | |
// https://twitter.com/wesbos/status/766703272887476224 | |
function removeUTM() { | |
const loc = window.location; | |
if (loc.search.includes('utm')) { | |
if (window.history.replaceState) { | |
history.replaceState({}, '', loc.pathname); | |
} else { | |
loc.hash = ''; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment