[英]How to implement analytics for facebook like?
is there a way , I can track facebook like with help of event tracking in google analystics ie. 有没有一种方法,我可以借助Google Analytics(分析)中的事件跟踪来跟踪Facebook。 i want to use ga('send', 'event', 'button', 'click', 'nav buttons', 4) ant not this code : ga('send', 'social', 'facebook', 'like', ' http://mycoolpage.com ');
我想使用ga('send','event','button','click','nav button',4)而不是此代码:ga('send','social','facebook','like ',' http://mycoolpage.com ');
Ok ..this is how we can implement Google analystics in facebook 好的..这就是我们可以在Facebook中实施Google分析的方法
1) Facebook like is added via its social plugin and Facebook provide events to handle like button for this put code like this in your jsp page . 1)Facebook like是通过其社交插件添加的,Facebook在您的jsp页面中提供了事件来处理此put代码的like button。
2) Facebook provide window.fbAsyncInit method and any event provided by Facebook can be written into it . 2)Facebook提供window.fbAsyncInit方法,Facebook提供的任何事件都可以写入其中。 3) more information can be obtained from
3)更多信息可以从
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.Event.subscribe('edge.create',function(href,widget) {
ga('send', 'social', 'facebook', 'like', 'your facebook page link');
});
};
</script>
<script type="text/javascript">
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=0000000000000";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-like-box" data-href="http://www.facebook.com/xxxxxxxxxxxx"
data-width="450" data-height="590" data-show-faces="true"
data-stream="true" data-header="true"></div>
</div>
我无法检查“赞”按钮,因为找不到它(假设您的网站是mycoolpage.com),但是您可以通过附加onclick处理程序来执行以下操作:
<a href="/some/path/to/like/button.html" onclick="ga('send','event','button','click','nav buttons', 4);">Facebook Like!</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.