How to record GA click events on fontello icons?

63 views Asked by At

I am using fontello to display share icons as below. I am trying to add Google Analytics such that if anyone clicks it is recorded. Currently, all I get is empty values. My GA code is below. How to fix it so that it records whether click is done on facebook, twitter or instagram icon?

    /* Tracks all a href links */
    $('a').click(function(e){
        ga('send','event','Link (Shares)', 'Click (Shares)',$(this).text().trim());
    }) 
/* html of the share code is below*/
<div class="swf-share-icons">
<a href="https://www.facebook.com/google" class="share-icon" title="Follow us on facebook"><i class="icon-facebook-squared"></i></a>
<a href="https://twitter.com/google" class="share-icon" title="Follow us on Twitter"><i class="icon-twitter"></i></a>
<a href="https://instagram.com/google" class="share-icon" title="Follow us on Twitter"><i class="icon-instagramm"></i></a
</div>
0

There are 0 answers