How too Real Time track Facebook Likes with Google Analytics

Build your Like button on the Facebook Widget Page as you like it should look. Chose XFBML button type.  Inside the <fb:like  we place the javascript to fire a google tracking.

onclick="javascript: _gaq.push(['_trackPageview', 'yourpagepost.com/facebook']);"

<fb:like onclick="javascript: _gaq.push(['_trackPageview', 'yourpagepost.com/facebook']);" href="http://www.youtpagepost.com/" ><fb:like>

These methode is slightly different then the standard way adding the social tracking code on page  and with

FB.Event.subscribe

. Its more usable if you render the like buttons dynamic. For my case i will track that way unlikes on a multi like page with several hundred Like buttons .

You Google Analytics account must be approved for the Beta Program.   

Leave a Reply

avatar
  Subscribe  
Notify of