带有Facebook Feed对话框的自定义共享按钮 - 跟踪共享?
问题描述:
我创建了一个将在Facebook内部用作选项卡的网页。 因此,用户可以点击一个自定义按钮并将其发布到墙上,我已经使用Feed对话框创建了一个自定义共享按钮(下面的示例代码)。带有Facebook Feed对话框的自定义共享按钮 - 跟踪共享?
https://www.facebook.com/dialog/feed?
app_id=458358780877780&
link=https://developers.facebook.com/docs/reference/dialogs/&
picture=http://fbrell.com/f8.jpg&
name=Facebook%20Dialogs&
caption=Reference%20Documentation&
description=Using%20Dialogs%20to%20interact%20with%20users.&
redirect_uri=https://mighty-lowlands-6381.herokuapp.com/
是否有可能找出有多少人将他们分享到他们的墙上?我们希望在此页面共享1000次时发布一些内容,但不知道如何计算或监控共享数量。可能吗?
答
是的,它是不是这样做的方式使用的JavaScript SDK,
var obj = {
method: 'feed',
link: ,//yourlink
picture: ,//the picture you want for the caption
name: ,
caption: ,
description: ,
display: 'popup'
};
function callback(response) {
//here you can check the response and see if it was shared
if (response && response.post_id){
//then do an ajax request that increases the share count for example
}
}
FB.ui(obj, callback);
答
回调只有一个RESPONSE_ID,你的确可以检查它是否是共享的,但如果你有一个页面上的多个sharebuttons它似乎没有可能知道它来自哪里以及增加什么。
致以问候