Skip to content

Instantly share code, notes, and snippets.

@scottcate
Last active September 5, 2017 09:33
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 scottcate/eeb1db780d9128a0c22079728996793b to your computer and use it in GitHub Desktop.
Save scottcate/eeb1db780d9128a0c22079728996793b to your computer and use it in GitHub Desktop.
Purpose of this gist, is to store the contents of a bookmarklet. This let's me quickly add two UTM query string parameters to the current page in a browser.
javascript:(function(){
var a = "scottca";
var l = window.location;
var s = l.search;
var utms = (s?s+"&":"?")+"utm_source="+a+"&utm_medium=twitter"+l.hash;
l.assign(utms);
})();
@scottcate
Copy link
Author

Revised to support the location.hash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment