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
});
}
})
Twitter API:https://dev.twitter.com/docs/tfw/events – Valentin
Facebook API:http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe – Valentin
LinkedIn API: https://developer.linkedin.com/plugins – Valentin