title: How to track Facebook Share button in Google Analytics (analytics.js)
body: <p>I am trying to track all the social interactions in my webpage using google analytics so that i can view them under Acquisition --> Social --> plugins.</p>
  
  <p>Currently i am able to track the facebook like and send buttons but share button is not tracked. I could not find any specific codes for Share button. Most of the codes out in the web are mentioned to be for both Share/Send but shares are not getting tracked. I have provided the code below</p>
  
  <pre><code>        &lt;html&gt;
      &lt;head lang="en"&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
  
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r; i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new    
      Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g; 
      m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  
      ga('create', 'UA-xxxxxxxx', 'auto');
      ga('send', 'pageview');
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="fb-root"&gt;&lt;/div&gt;
        &lt;script&gt;
        $(document).ready(function(){
      alert('doc loaded');
  });
  
        window.fbAsyncInit = function() {
          FB.init({
            appId      : 'xxxxxxxxxxxxxxxxxx',
            status     : true,
            xfbml      : true
          });
                  //Logged In Users
          FB.getLoginStatus(function(response) {
              if (response.status !== "unknown") { 
                  ga('set', 'dimension1', 'Logged In');
              }
          });
  
          //Facebook Likes 
          FB.Event.subscribe('edge.create', function(href, widget) {
              var currentPage = $(document).attr('title');
              ga('send', {
                  'hitType': 'social',
                  'socialNetwork': 'Facebook',
                  'socialAction': 'Like',
                  'socialTarget': href,
                  'page': currentPage,
                  'hitCallback': function() {
                   alert('like done sending data');
    }
  
              });
          });
  
          //Facebook Unlikes
          FB.Event.subscribe('edge.remove', function(href, widget) {
              var currentPage = $(document).attr('title');
              ga('send', {
                  'hitType': 'social',
                  'socialNetwork': 'Facebook',
                  'socialAction': 'Unlike',
                  'socialTarget': href,
                  'page': currentPage,
                  'hitCallback': function() {
      alert('unlike done sending data');
    }
  
              });
          });
  
          //Facebook Send/Share
          FB.Event.subscribe('message.send', function(href, widget) {
  
  
              var currentPage = $(document).attr('title');
              ga('send', {
                  'hitType': 'social',
                  'socialNetwork': 'Facebook',
                  'socialAction': 'Send',
                  'socialTarget': href,
                  'page': currentPage,
                  'hitCallback': function() {
      alert('send done sending data');
    }
  
              });
          });
  
          //Facebook Comments
          FB.Event.subscribe('comment.create', function(href, widget) {
              var currentPage = $(document).attr('title');
              ga('send', {
                  'hitType': 'social',
                  'socialNetwork': 'Facebook',
                  'socialAction': 'Comment',
                  'socialTarget': href,
                  'page': currentPage,
                  'hitCallback': function() {
      alert('comment done sending data');
    }
  
              });
          });
        };
  // Load Facebook SDK
      (function(d, s, id) {
       var js, fjs = d.getElementsByTagName(s)[0];
       if (d.getElementById(id)) return;
       js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&amp;version=v2.4&amp;  appId=xxxxxxxxxxxx";
        fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
        &lt;/script&gt;
  
  
        &lt;p&gt;&lt;a href="www.example.in" &gt;Some Text &lt;/a&gt;&lt;/p&gt;
  
        &lt;script src="//connect.facebook.net/en_US/all.js#xfbml=1"&gt;&lt;/script&gt;
        &lt;fb:like&gt;&lt;/fb:like&gt;
  
       &lt;div class="fb-share-button" data-href="https://example.com"  data-layout="button_count"&gt;&lt;/div&gt;
  
       &lt;div class="fb-send" data-href="http://example.com"&gt;&lt;/div&gt;
  
  
  
        &lt;/body&gt;
        &lt;/html&gt; 
  </code></pre>
  
  <p>I saw FB.event.subscribe method parameters from this link <a href="https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/v2.4" rel="nofollow">https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/v2.4</a> but there is no specific parameter for share.
  what am i doing wrong? Or is it not possible to track share button in facebook.</p>