我在Facebook上使用new Share button。有没有办法检测分享事件?我查看了FB.Event API,但我找不到哪个事件与成功共享匹配。
我使用Share Button
documentation page生成我正在使用的代码。
JS:
<div id="fb-root"></div>
<script>(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_GB/all.js#xfbml=1&appId=xxxxxxxxxxx";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
HTML:
<div class="fb-share-button" data-href="http://developers.facebook.com/docs/plugins/" data-type="button_count"></div>
答案 0 :(得分:2)
分享按钮不提供跟踪共享事件的可能性,至少据我所知。
如果你想“倾听”分享事件,你想要做Fabio建议并使用分享对话框:https://www.facebook.com/dialog/feed?app_id=APP_ID&display=popup&link=http://example.com&redirect_uri=http://example.com/someone_shared_on-fb.php
,或类似的东西。
答案 1 :(得分:1)
您可以尝试使用FQL:Facebook查询语言。
SELECT share_count,like_count,comment_count,total_count 来自link_stat url url =“http://www.mysite.com/some-page”
通过此链接查看您的回复 https://developers.facebook.com/tools/explorer
所以用户共享的所有内容,你想要一个跟踪只是保持其网址并运行查询,那里将提供喜欢,分享和评论的数量
干杯并继续滚动