【问题标题】:Facebook Insights clarification about end_date, period and API call resultFacebook Insights 澄清 end_date、period 和 API 调用结果
【发布时间】:2012-01-21 16:21:28
【问题描述】:

我无法弄清楚 end_dateperiod 参数 (?) 的含义以及对 page_impressions 指标(不带参数)的 API 调用结果。

我查询上周的page_impressions。响应包含时间段“week”(即第二个数组),还包含 3 个嵌套数组,其中包含不同的 end_time。这个结束时间让我很困惑。

这应该如何解释?我应该使用 PHP SDK 的 api() 方法来控制这些参数吗?

这是一个示例响应:

array
  'id' => string '194501267300320/insights/page_impressions/day' (length=45)
  'name' => string 'page_impressions' (length=16)
  'period' => string 'day' (length=3)
  'values' => 
    array
      0 => 
        array
          'value' => int 1473
          'end_time' => string '2012-01-17T08:00:00+0000' (length=24)
      1 => 
        array
          'value' => int 1100
          'end_time' => string '2012-01-18T08:00:00+0000' (length=24)
      2 => 
        array
          'value' => int 1194
          'end_time' => string '2012-01-19T08:00:00+0000' (length=24)
  'title' => string 'Daily Total Impressions' (length=23)
  'description' => string 'Daily The number of impressions seen of any content
     associated with your Page. (Total Count)' (length=92)

array
  'id' => string '194501267300320/insights/page_impressions/week' (length=46)
  'name' => string 'page_impressions' (length=16)
  'period' => string 'week' (length=4)
  'values' => 
    array
      0 => 
        array
          'value' => int 12762
          'end_time' => string '2012-01-17T08:00:00+0000' (length=24)
      1 => 
        array
          'value' => int 11943
          'end_time' => string '2012-01-18T08:00:00+0000' (length=24)
      2 => 
        array
          'value' => int 12280
          'end_time' => string '2012-01-19T08:00:00+0000' (length=24)
  'title' => string 'Weekly Total Impressions' (length=24)
  'description' => string 'Weekly The number of impressions seen of any content
     associated with your Page. (Total Count)' (length=93)

Facebook 开发者页面上提到了 period

收集指标的时间长度, 以秒为单位表示为 86400(天)、604800(周)、2592000 之一 (month) 或 0 (lifetime) 或使用函数 period() 取一 字符串中的日、周、月或生命周期。

注意:每个指标可能没有所有可用的时间段。

end_time

收集指标的时期结束, 表示为 unix 时间(应始终为午夜,太平洋 夏令时)或使用函数 end_time_date() 'YYYY-MM-DD' 格式的日期字符串。

【问题讨论】:

    标签: php facebook facebook-graph-api


    【解决方案1】:

    这是我有根据的猜测:

    对于索引 0:从 2012 年 1 月 11 日到 2012 年 1 月 17 日,页面展示次数为 12762 次​​p>

    'period' => string 'week' (length=4)
     0 => 
        array
          'value' => int 12762
          'end_time' => string '2012-01-17T08:00:00+0000' (length=24)
    

    对于索引 1:从 2012 年 1 月 10 日到 2012 年 1 月 16 日,页面展示次数为 11943 次

    'period' => string 'week' (length=4)
     1 => 
        array
          'value' => int 11943
          'end_time' => string '2012-01-18T08:00:00+0000' (length=24)
    

    【讨论】:

    • 顺便说一句,这是一个很好的起点。我必须找到一种方法来确认这一点,即使我不明白如何将end_date 传递给developers.facebook.com/docs/reference/php/facebook-api
    • 你的问题是如何解释(你甚至加粗了那部分,所以我们不会错过它)。不是如何通过 end_date。这完全是一个单独的问题。除非将它们创建为新问题,否则后续问题将不受欢迎。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-27
    • 1970-01-01
    • 2014-04-10
    相关资源
    最近更新 更多