Last active
May 6, 2018 05:32
-
-
Save mak00s/b4c4b3d1281dc46978544ee824867380 to your computer and use it in GitHub Desktop.
キャンペーン用URLパラメータをキレイにする(ga.js)
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
_gaq.push(['_setAllowLinker', true]); | |
_gaq.push(['_setAllowAnchor', true]); | |
_gaq.push(function(){ | |
if (location.hash && location.hash.match(/(#|&)(utm_source|__utma)=.+/)) { | |
if ('replaceState' in history) | |
history.replaceState('',document.title, location.pathname + location.search); | |
else location.hash = ''; | |
} | |
}); | |
_gaq.push(['_trackPageview']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment