Last active
August 29, 2015 14:05
-
-
Save richardh-vccp/698c16ce5b0fe4ee894b to your computer and use it in GitHub Desktop.
Add tracking tag before hash fragment
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
function add_tracking_tag(u, t) { | |
var url = u, | |
tag = t; | |
if (url.match('#')) { | |
url = url.replace('#', tag + '#'); | |
} else { | |
url = url + tag; | |
} | |
return url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment