FB.Event.subscribe是否有Facebook Share按钮事件? [英] Is there a Facebook Share button event for FB.Event.subscribe?

查看:202
本文介绍了FB.Event.subscribe是否有Facebook Share按钮事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找在Facebook Like按钮和Facebook分享按钮之间分割测试点击。我知道我可以附加FB.Event.subscribe('edge.create',...)的事件处理程序来跟踪Facebook上的点击按钮,但是是否有一个相应的Facebook共享按钮事件? FB.Event.subscribe文档中似乎没有显示。

I'm looking to split test clicks between the Facebook Like button and Facebook Share button. I know I can attach an event handler of FB.Event.subscribe('edge.create',...) to track clicks on the Facebook like button, but is there a corresponding event for the Facebook share button? There doesn't appear to be on in the FB.Event.subscribe documentation.

推荐答案

没有事件 - 如果您需要在用户从您的应用程序中点击共享时收到通知,您应该创建自己的共享按钮,并在点击时显示Feed /共享对话框:

There is no event for this - if you need to be notified when a user clicks shares from within your app, you should create your own share button and display the Feed/Share dialog when clicked:

$('#shareButton').click(function() {
    FB.ui({
        method: 'feed',
        link: 'https://developers.facebook.com/docs/dialogs/',
        caption: 'An example caption',
    }, function(response){
        if (response === null) {
            console.log('was not shared');
        } else {
            console.log('shared - post id is ' + response.post_id);
        }
    });
});

这篇关于FB.Event.subscribe是否有Facebook Share按钮事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆