Track Addthis widget in Google Analytics
Addthis is often seen on blogs and other social media things. They have a small widget such as the one appearing at the bottom of this article. It gives the choice to bookmark or share the page with several services.
Track interactions with social networks.
In a social networks perspective, that would be interesting to track those external links in Google Analytics. Unfortunately, since links are not pure <a> tags, our automatic script to track outbound links with Google Analytics doesn’t work. And anyway, the div element containing the links is loaded dynamically and is not available on page load.
An update to the Wordpress plugin
For the purpose of this proof of concept, we have updated the Addthis plugin for Wordpress, so that a new option is available in the configuration panel. Simply add your custom code here; it will be executed in the onclick event attached to each link within the Addthis box. You can add a virtual page view, an event, or whatever you like for any tool.
This will simply execute the Javascript code defined in the configuration panel, such as on this blog:
GoogleAnalytics.customLink("exit","Addthis:"+this.childNodes[0].innerHTML,”");
Next steps will be to see if it’s possible to tag the complete links set when a visitor clicks on the “more” button.
This post was written by Alex
Tags: Google Analytics




May 21, 2009
Hey, my name is Justin Thorp and I’m the Community Manager for AddThis. Cool article. Thanks for writing it and thanks for being excited about AddThis. We really appreciate it. We’re working on Google Analytics integration and hope to have that out soon. Stay tuned. If there is anything else we can help with to make it better for you, don’t hesitate to drop me a line - justin@addthis.com
May 22, 2009
Thanks for the information! Do you plan to support custom GA code? Such as event tracking, or even a free text field to let users add whatever they want as Javascript code?