By Scott Thomas
Perhaps you saw the articles a couple of weeks ago, indicating that Google had officially announced that its Google Analytics product was now able to track social media interaction. As the linked article mentioned, this is a welcome addition to the built-in capability of the Google +1 button to track clicks. However, this bit of news was soon overshadowed by all the buzz surrounding the (as yet, despite being enormous, and frequently discussed) beta of Google+ – the new Google social platform.
We had seen the articles and sort of filed them away for future reference. A friend got in touch last week, however, asking how to implement this, and indicating that the information wasn’t very clear. After reading the official documentation, we certainly had to agree. However, after a bit of testing, we were able to get it to work, and provide the results here, in case you’d like to use Google Analytics to track various social interaction on your website, blog, or whatever.
What we’re trying to accomplish
For the rest of us, there are three pieces of code to insert (We haven’t attempted to use anything but Facebook and Twitter – though the same principle would work with any; also Google +1 forwards data to GA automatically, so there is no need to do anything special for it), and of course a couple of prerequisites.
Code needed to make this work:
<div id=“fb-root”></div><br /> <fb:like href=“http://www.YOURDOMAIN.com/PAGETOTRACK" send=“true” show_faces=“false” layout=“button_count”></fb:like> Then change YOURDOMAIN.com to your domain, and PAGETOTRACK to the path and page you want to have the button track. Do not omit the div with the fb-root id.
<p> </p> <li> Just before the closing body tag on the page, put <p> <code><script><br />
_ga.trackSocial();<br /> </script>
<p> Done and done. </p> <p> Social activities seem to show up in the new Google Analytics within an hour or so. </p>