Last active
August 29, 2015 14:23
-
-
Save awavering/0fe0b170b0c449809c3a to your computer and use it in GitHub Desktop.
Removes UTM parameters from the url after a successful pageview call, reducing the likelihood of polluted referral information.
This file contains hidden or 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
ga('send', 'pageview', { | |
'hitCallback': function() { | |
if (history.replaceState) { | |
window.history.replaceState('utm', document.title, window.location.pathname); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment