2010-12-13 80 views
0

嘿! 我无法获取可靠的每月活动用户数量的我的应用程序。我用FQL试了一下:通过Facebook Graph API正确获取每月活跃用户的问题

[...] 
    $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

Facebook洞察数据不适时提供。洞察图将始终显示历史数据。

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

+0

嘿thx很多!帮助我!我也发现这个:http://stuff24.de/blog/monthly-active-users-facebook-fql/ – acy 2010-12-19 18:19:52

相关问题