A Bookmarklet To Remove UTM Tracking In URLsDecember, 2022
I make a lot of reference links for my posts. I end up spending a bunch of time ripping the UTM tracking query parameters out of them. I knew I could set up something to scrub them but hadn't given it much though until this post from Chris Biscardi on Mastodon nerd sniped me.
The result is this code for a bookmarklet that removes the UTM params from the current URL and reloads the page without them. It also copies the scrubbed URL to the clipboard.
This is very much a "works on my machine" solution (which, in this case is a mac running chrome). It's not doing anything wild so I expect it can be made to work most places if it doesn't fire out of the box.
To use it, make a new bookmark and then edit it to put in this code. It has to all be on one line for it to work.