Remove weird Hashtag codes from AddThis Share buttons
AddThis is one of the best services to add share buttons to your website for free. It allows you to pick your buttons, grab a small piece of code, and put it on your website, that’s it!
But while using AddThis buttons on this website, I noticed strange hash codes or random characters added to the URLs in the shares done using the buttons. You may see it yourself by clicking the AddThis tweet button, the tweet window will show the code I’m talking about.
I’m not using AddThis now, but in this post, I’m sharing how to remove that weird piece of code from your URLs if you’re using AddThis on your site.
Why AddThis adds this extra code to my URLs?
The extra code is actually an identifier string that is added for the URL tracking purposes. AddThis provides two types of URL tracking by default: Click tracking and Address bar tracking. The role of these tracking parameters is to track the traffic sources using the AddThis analytics.
With the click tracking enabled, the link appears something like this in the shares:
In the Address bar tracking mode, the 11-character identifier is added to the shared URL:
Getting rid of weird code in AddThis shares
Remember that you have to put the above code just before the closing head tag (
</head>) in your website’s HTML. After saving changes, you will notice no extra hash codes added to your shared links.
Separate code to disable specific tracking
In case you are not wishing to disable both AddThis tracking types for your URLs, below are the separate codes to disable a specific tracking.
Disable Click tracking
Disable Address bar tracking