Wednesday, 29 July 2015

How to Track Facebook Likes in Google Analytics

type='html'>
Most of the websites nowadays have the Facebook like button installed on them. But, a few of the webmasters know how to capitalize the worth of the like button by carefully tracking which pages of your website are the most popular and generates the maximum of likes. In layman terms, you can track the number of Facebook likes from each of your individual pages in order to find out which pages on your site are the most popular and receives the maximum Facebook shares. This is referred as "Social Interaction Web Tracking".

Facebook Like Button Tracking


You will need to utilize the Facebook's edge.create button and create a call back function.

Here is the code to do so:-

SYNTAX

FB.Event.subscribe('edge.create', function(targetUrl) {
  _gaq
.push(['_trackSocial', 'facebook', 'like', targetUrl]);
});

Required Script

You need to add the script given below just after the Facebook insights script:- 

<script>
  window.fbAsyncInit = function() {
    FB.Event.subscribe('edge.create', function(targetUrl) {
      _gaq.push(['_trackSocial', 'facebook', 'like', targetUrl]);
    });
</script>

The above script will start tracking the number of likes that people make while sharing your site's content on Facebook.

Also See:- 

Facebook Graph Search
Facebook Voice Messages


No comments:

Post a Comment