【问题标题】:Custom Share button with Facebook Feed Dialog - Track shares?带有 Facebook Feed 对话框的自定义共享按钮 - 跟踪共享?
【发布时间】:2013-03-22 16:17:53
【问题描述】:

我创建了一个网页,该网页将在 Facebook 内部用作选项卡。 因此用户可以单击自定义按钮并将其发布到他们的墙上,我使用 Feed Dialog 创建了自定义共享按钮(下面的 Facebook 示例代码)。

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 次时发布一些内容,但不知道如何计算或监控分享次数。有可能吗?

【问题讨论】:

    标签: facebook share


    【解决方案1】:

    是的,不是那样做,而是使用 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);
    

    【讨论】:

      【解决方案2】:

      回调只有一个 response_id,您确实可以检查它是否被共享,但是如果您在一个页面上有多个共享按钮,它似乎无法知道它来自哪里以及要增加什么计数器。

      最好的问候

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-08-07
        • 1970-01-01
        • 2020-04-25
        相关资源
        最近更新 更多