Thursday, July 07, 2011 | 10:59 AM
With our recent Social Plugin Analytics launch you now have the ability to analyse how users engage with any social plugin such as Google’s +1 button and Twitter’s Tweet button. Now it’s time for the lowdown on how to set this feature up to work for you. If you are a developer, you should pay particularly close attention.
If you’ve added +1 buttons to your site and your Analytics implementation is up to date, integration is automatic and you should already see data in your account. You can ensure the +1 integration is working by taking some simple steps.
_gaq.push([‘_trackSocial’, socialNetwork, socialAction]);
And if you’re using the traditional snippet you’ll need to use this syntax:
var pageTracker = _gat._createTracker(‘UA-xxxxx-y’);
You then want to call this method somewhere where you know the social plugin has been clicked on. We’ve included some example on how this work with Twitter’s plugin API as well as Facebook’s plugin API and you can see a working demo here. Sweet!
If you are building an integration for use by several Analytics users we encourage you to use the code for the async snippet for now. Also, to enable the development of integrations such as these we would like to share with our customers that we are working toward better compatibility between the sync and async tags with the goal of enabling calls such as _trackSocial to work for both version with the same syntax.
Finally, if you are a developer of a content management plugin which adds social plugins to websites, or if you build social plugins, we want to work with you! Ideally we’d love for all users of your plugin and Google Analytics to have seamless social analytics. In the developer community spirit we’re giving out free t-shirts to the first 100 developers who integrate a social plugin, or a Content Management plugin that adds social widgets to sites with Google Analytics. Let us know what you’ve done by submitting your plugin here.UPDATE: 7/8/11 5:30pm PST, corrected references to the social plugin analytics feature.
Posted by John Jersin, Google Analytics Team