2015-10-14 38 views
2

我想跟踪分析(使用Google Analytics),我的网页到Google+,Twitter,LinkedIn和Pinterest的完成了多少份额使用他们在我的网站上的自定义按钮。如何将Google Analytics应用于自定义按钮以使用jQuery在网站上进行社交分享

但是,我无法找到相同的API。

我使用下面的代码这样做是为了FB:

FB.ui(
    { 
      method: 'share', 
      href: location.href, 
    }, 
    function(response) { 
     if (response && response.post_id) { 
      ga('send', { 
       'hitType' : 'social', 
       'socialNetwork' : 'Facebook', 
       'socialAction' : 'Share', 
       'socialTarget' : location.href, 
       'page' : location.pathname 
      }); 
     } 
}) 

回答

1

请看看到Komito Analytics怎么做。请参阅source code中的功能。

+0

Twitter API:https://dev.twitter.com/docs/tfw/events – Valentin

+0

Facebook API:http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe – Valentin

+0

LinkedIn API: https://developer.linkedin.com/plugins – Valentin

相关问题