Why I strip the Facebook “click ID” parameter
The ?fbclid=<hash>
parameter litters the world’s bookmarks, pinboard pins, and URLs all around. Want to share that interesting article with a friend? Copy, paste and… what is all this junk?!
https://www.abc.net.au/triplej/programs/hack/coronavirus-covid19-isolation-third- quarter-phenomenon-has-begun/12190270?fbclid=IwAR3MvgCDBX9v2MWMEIJ8n6TaA0O- pmBIGsDqGiKFqI59djXjT6duQZyPNxs
When people share a page or article from Going Love First, I want them to have a clean and enjoyable experience, especially if they’re manually interacting with the link. The fbclid
junk messes with that, and distracts from some of the intentional little things I’m doing with the URLs across this site.
To improve that experience, across this site I strip that junk from the URL after the page loads.
(I also suspect Facebook is using this to extend its awareness of your social network by tracking which people follow your unique fbclid
links, suggesting connections that you may not have on the site itself. But note: I have no evidence for this.)
How to remove the fbclid
parameter
This is a simple, modern, and widely supported solution that uses dedicated API’s for interacting with search parameters (which the fbclid
is hijacking). In the case of this particular gist (code snippet) below, it uses jQuery for the document.ready
check, because honestly, that just allowed me to easily implement it on goinglovefirst.com and it’s a more widely understood technique: