Using Custom Social Bookmark Icons With AddThis Analytics

(Note: This code is meant to be put in your WordPress Template. However, it should be easy to modify it for other uses.)

Awhile back, I tweeted about how I wasn’t a huge fan of the AddThis button and I felt the need for more actionable social sharing buttons. That led to a few conversations with an AddThis representative about how I could still use their JavaScript to help track my custom buttons usage.

So now, with this code, you can use any custom social bookmarklet you like, and still track the button usage.

So first and foremost you will need an AddThis account.

Then you need to add the AddThis javascript to your HTML. I like to put it in the footer so all of my content can load first.


Next, you will need to add the following javascript, substituting the “YOUR-ACCOUNT-ID” with your AddThis username. I usually put this right above the first link that will be using the AddThis code.

 

Finally you will need to add the ‘onclick’ javascript to the anchor tag like I do in the example below. The key here is to put the name of the service you wish the button to link to where I have inserted ‘stumbleupon’ below. A full list of services can be found on the AddThis custom services page.


So that is how I am able to track my sharing button usage on my site through AddThis without using the AddThis button.

0saves
Leave a comment below and continue the conversation, or subscribe to my RSS feed to get articles like this delivered automatically to your feed reader.