我正在使用fontello显示共享图标,如下所示。我正在尝试添加Google Analytics,以便在有人点击时进行记录。目前,我得到的只是空值。我的GA代码如下。如何解决它,以便记录点击是否在Facebook,Twitter或Instagram图标上完成?
/* 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>