2012-01-21 69 views
1

我無法弄清end_dateperiod參數(?)的含義以及page_impressions度量標準(不帶參數)的API調用結果。Facebook Insights關於end_date,句點和API調用結果的說明

我查詢了上週的page_impressions。響應包含週期「周」(即第二個數組),並且還包含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 (月)或0(終生)中的一個或使用功能週期(),其中需要一個 個字符串日,周,月或一生。

注意:每個指標可能沒有可用的所有時段。

end_time

在此期間收集的指標的時間段的結束, 表示爲UNIX時間(應該始終是午夜,太平洋 夏令時)或使用函數end_time_date()採用'YYYY-MM-DD'格式的日期字符串 。

回答

0

這是我的猜測:

對於指數0:從2012-01-11到2012-01-17有12762個網頁展示

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

對於指數1:從2012- 01-10至2012-01-16共有11943頁展示

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

那麼這是一個很好的起點。我必須找到一種方法來確認這一點,即使我不明白如何將'end_date'傳遞給http://developers.facebook.com/docs/reference/php/facebook-api/ – gremo

+0

您的問題是來解釋(你甚至粗暴的那部分,所以我們不會錯過它)。不是如何傳遞end_date。這完全是一個單獨的問題。後續問題被忽視,除非它們被創建爲一個新問題。 – DMCS