Social Plugin Analytics in Google Analytics
Thursday, July 07, 2011 | 10:59 AM
Labels: Social
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.
If you want to integrate with other social plugins, like Twitter, we’ve also made it really easy. The latest version of the tracking code has a new _trackSocial method to capture various aspects of a social plugin interaction. Using the async javascript snippet, the easiest way to call this method is to use:
_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’);
pageTracker._trackSocial(socialNetwork, socialAction);
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.


18 comments:
William Smith said...
Hey! I have been using Google Analytics from quite a long time but did not access this Plug in. Otherwise Google Analytics is one good tool to assess your development .
1:34 AM
sixdoublesix said...
I have the latest version of analytics code and I have added the Google +1 but I still dont see any reporting. People have also clicked a number of +1 buttons also!
or will I still need to add the snippet. Can someone have a look please :)
www.broadbandbuyer.co.uk
2:52 AM
justmarried said...
Google not yet updated the Google analytics code on GA
5:26 AM
timware2011 said...
Is there a way to track the LinkedIn Share button using the new GA? Thanks.
6:56 AM
tox said...
nice! this is a good way to get a demographic of our website(s).
hope to get more features included in the tracker.
3:39 PM
Elvin said...
It would be great if you could suggest me where to add this code:
var pageTracker = _gat._createTracker(‘UA-xxxxx-y’);
pageTracker._trackSocial(socialNetwork, socialAction);
Thank you!
4:42 AM
AYCC said...
www.aceyourcollegeclasses.com
This site offers students in College the opportunity to post questions that they are struggling with and get homework help fast! It also offers students to earn money while uploading tutorials and answering questions. The site pays out a hefty 75% for all tutorials sold compared to other sites. Aceyourcollegeclasses.com is on the rise with helping College students get the grades they deserve. It is free to join and takes about a minute to register.
12:37 PM
Bob Van Zandt said...
I'm not sure if the combination of multi-domain/sub-domain configurations is working correctly with social tracking...
I recently changed it all and i've got from several thousand hits a day to just 12. but, my FB Likes are still amassing about 1000 per day, and I can see way more than 12 people on our site in other reports...
Here's the detail:
----------------------------
Site 1 - sonvine.com
----------------------------
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-9987378-18']);
_gaq.push(['_setDomainName', 'sonvine.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setAllowHash', false]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
----------------------------
Site 2 - songear.com
----------------------------
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-9987378-18']);
_gaq.push(['_setDomainName', '.songear.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setAllowHash', false]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
----------------------------
Site 3 blog.songear.com
----------------------------
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-9987378-18']);
_gaq.push(['_setDomainName', '.songear.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setAllowHash', false]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
----------------------------
site 4 christmas.songear.com
---------------------------
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-9987378-18']);
_gaq.push(['_setDomainName', '.songear.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setAllowHash', false]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
shouldn't I be able to use all of this together under one profile?
7:58 AM
Cameron van U said...
When will we be able to add social interactions to our Custom Reports?
1:58 AM
Geogoer.com said...
2:18 AM
Dalia said...
or you can use Campalyst.com /sorry for self promotion :)/ - we support google analytics and track social media results with no manual link-building.
2:20 AM
umbrella contractor said...
nice to see how all our social activity is affecting our overall return on investment. Is there any easy way of intergrating this into a wordpress blog?
4:09 AM
Frits said...
Since I placed the Social code into the tracking code my bounce rate dropped from 70% to 0%. Is anybody else having the same issue?
4:32 AM
Zambo said...
Does it work on Internet Explorer?
I had no problem with Facebook callbacks. But when I try to tweet something there's no track. No event, no error... nothing.
Any solution?
7:40 AM
Ronit Baras said...
John, the asynchronous line contains an invalid HTML character. The single quotes became "smart".
Oops.
The correct line is
_gaq.push(['_trackSocial', socialNetwork, socialAction]);
3:43 AM
Dealshelve said...
Thank you. It just works! (I'm not Steve Jobs)
1:53 AM
Paulo Andraus said...
I made all the changes, but just Google+ worked on.
Is someone from Brasil in this forum?
7:00 AM
mdg33 said...
Correct me if I'm wrong, but does this mean you have to manually recode all your social media buttons on your website?
10:41 PM
Post a Comment