正确获得每月活跃用户的问题(通过Facebook Graph API)

时间:2010-12-13 14:20:13

标签: facebook facebook-graph-api facebook-fql

嘿那里! 我无法获取应用程序的可靠月度活跃用户数。我用FQL试了一下:

[...]
  $end_time = date('Y-m-d', time()-(60*60*24*2)); // Dont' know what is correct. Sometimes it's *2 sometimes it's working with *3
  $fql = $facebook->api(array(
                        "method"  => "fql.query",
                        "query"   => "SELECT metric, value FROM insights WHERE object_id='000000000' AND metric='application_active_users' 
       AND end_time=end_time_date('".$end_time."') 
       AND period=period('month')"
     ));
[...]

看起来无法获得最新的价值。我想获得与我的申请页面上所述相同的价值。但是这个代码每天都有所不同。

我也试过这个解决方案:

  $fql = $facebook->api('/000000000/insights/application_active_users/month');

但作为回应,我只得出几天前的过时值:

Array
(
    [data] => Array
        (
            [0] => Array
                (
                    [id] => 000000000/insights/application_active_users/month
                    [name] => application_active_users
                    [period] => month
                    [values] => Array
                        (
                            [0] => Array
                                (
                                    [value] => 166345
                                    [end_time] => 2010-12-09T08:00:00+0000
                                )
                            [1] => Array
                                (
                                    [value] => 167679
                                    [end_time] => 2010-12-10T08:00:00+0000
                                )
                            [2] => Array
                                (
                                    [value] => 168983
                                    [end_time] => 2010-12-11T08:00:00+0000
                                )
                        )
                    [description] => Monthly Users who have engaged with your application or viewed your application (Unique Users)
                )
        )
    [paging] => Array
        (
            [previous] => https://graph.facebook.com/000000000/insights/application_active_users/month?since=1291556506&until=1291815706
            [next] => https://graph.facebook.com/000000000/insights/application_active_users/month?since=1292074906&until=1292334106
        )
)

我做错了什么?

1 个答案:

答案 0 :(得分:1)

Facebook洞察数据暂时无法使用。洞察图始终仅显示历史数据。

如果您对当前的monthly_active_users号感兴趣,可以使用fql查看applications表。