Javascript 如何使用jQuery将Google Analytics应用于网站上定制的社交共享按钮

Javascript 如何使用jQuery将Google Analytics应用于网站上定制的社交共享按钮,javascript,jquery,twitter,google-analytics,linkedin,Javascript,Jquery,Twitter,Google Analytics,Linkedin,我想跟踪分析(使用Google analytics),从我的页面到Google+、Twitter、LinkedIn和Pinterest,使用我网站上定制的按钮,已经完成了多少共享 但是,我找不到同样的API 我使用以下代码为FB完成此操作: FB.ui( { method: 'share', href: location.href, }, function(response) { if (response &

我想跟踪分析(使用Google analytics),从我的页面到Google+、Twitter、LinkedIn和Pinterest,使用我网站上定制的按钮,已经完成了多少共享

但是,我找不到同样的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
            });
        }
})
请看一下你是怎么做的。请参阅。

Facebook API中的函数: