Unable to understand the values ​​returned by the Facebook Insights API.

I do not understand how the API returns values. Here is an example of calling page_impressions, with "week" as the period.

"values"=> [{"end_time"=>"2012-01-08T08:00:00+0000", "value"=>1116}, {"end_time"=>"2012-01-09T08:00:00+0000", "value"=>1171}, {"end_time"=>"2012-01-10T08:00:00+0000", "value"=>1175}] 

It seems that they show how many hits I had in the last 7 days before the date in "end_time", is this correct? If so, then I don’t understand what use it has, there is a huge overlap in the data.

How can I get the number of impressions of recent weeks? And how can I get more than 3 values ​​to display? I really can not understand the logic of this and how it can be useful.

+4
source share
1 answer

What happens here is that you are given the total number of page_impressions for the 7-day period ending on each of the indicated dates (i.e. how many times the page has been viewed in the last 7 days if the week ended on end_time ?, and then on end_time + 1? end_time + 2)

Facebook returns three (3) separate readings, presumably so that you can identify or view very local trends (for example, “are my weekly impressions coming?) Or, perhaps, because you missed the measurement and want to have values ​​for each day.

To answer your question specifically:

  • The 7-day period from 2012-01-01 to 2012-01-08 12:00 am * had 1,116 impressions.
  • The 7-day period from 2012-01-02 to 2012-01-09 12:00 am * had 1,171 impressions.
  • The 7-day period from 2012-01-03 to 2012-01-10 12:00 in the morning had 1175 impressions.

    • As indicated below, end_time is always midnight in the PDT. Thus, end_time 2012-01-08 really means that the measurement stopped the night before, i.e. At 1 minute 23:59 on 2012-01-07.

From https://developers.facebook.com/docs/reference/fql/insights/ :

The end of the period during which metrics were collected, expressed as UNIX time (which should always be midnight, Pacific Daylight Time) or using the end_time_date () function, which accepts dates in the format "YYYY-MM-DD". Note. If UNIX time is specified, not midnight, quiet daytime, your request may return an empty ResultSet. Example. To receive data for a 24-hour period, starting from September 15 at 00:00 (i.e. 12:00 at midnight) and ends in September the 16th at 00:00 (i.e. 12:00 at midnight ), specify 1284620400 as end_time and 86400 as the period. Note: end_time should not be specified when requesting lifetime indicators.

+5
source

Source: https://habr.com/ru/post/1390727/


All Articles