Why does the Facebook Graph API only respond with 5 days given a 7 day range?

183 views Asked by At

Apologies if this is not worded and formatted correctly, I am fresh out of bootcamp.

My app queries a Facebook users page for analytic data using the following endpoint:

{page_id}/insights/?since=08/01/2020&until=08/07/2020&metric=page_engaged_users

The data i receive back is:

{
   "data":[
      {
         "name":"page_engaged_users",
         "period":"day",
         "values":[
            {
               "value":0,
               "end_time":"2020-08-02T07:00:00+0000"
            },
            {
               "value":0,
               "end_time":"2020-08-03T07:00:00+0000"
            },
            {
               "value":0,
               "end_time":"2020-08-04T07:00:00+0000"
            },
            {
               "value":0,
               "end_time":"2020-08-05T07:00:00+0000"
            },
            {
               "value":0,
               "end_time":"2020-08-06T07:00:00+0000"
            }
         ],
         "title":"Daily Page Engaged Users",
         "description":"Daily: The number of people who engaged with your Page. Engagement includes any click or story created. (Unique Users)",
         "id":"137088133587412/insights/page_engaged_users/day"
      },
      {
         "name":"page_engaged_users",
         "period":"week",
         "values":[
            {
               "value":0,
               "end_time":"2020-08-02T07:00:00+0000"
            },
            {
               "value":0,
               "end_time":"2020-08-03T07:00:00+0000"
            },
            {
               "value":0,
               "end_time":"2020-08-04T07:00:00+0000"
            },
            {
               "value":0,
               "end_time":"2020-08-05T07:00:00+0000"
            },
            {
               "value":0,
               "end_time":"2020-08-06T07:00:00+0000"
            }
         ],
         "title":"Weekly Page Engaged Users",
         "description":"Weekly: The number of people who engaged with your Page. Engagement includes any click or story created. (Unique Users)",
         "id":"137088133587412/insights/page_engaged_users/week"
      },
      {
         "name":"page_engaged_users",
         "period":"days_28",
         "values":[
            {
               "value":0,
               "end_time":"2020-08-02T07:00:00+0000"
            },
            {
               "value":0,
               "end_time":"2020-08-03T07:00:00+0000"
            },
            {
               "value":0,
               "end_time":"2020-08-04T07:00:00+0000"
            },
            {
               "value":0,
               "end_time":"2020-08-05T07:00:00+0000"
            },
            {
               "value":0,
               "end_time":"2020-08-06T07:00:00+0000"
            }
         ],
         "title":"28 Days Page Engaged Users",
         "description":"28 Days: The number of people who engaged with your Page. Engagement includes any click or story created. (Unique Users)",
         "id":"137088133587412/insights/page_engaged_users/days_28"
      }
   ],
   "paging":{
      "previous":"https://graph.facebook.com/v8.0/137088133587412/insights?access_token=EAAKPk7foIPMBAGtZCNNZBPVXyOZA6zzLV4Ni7YagWXDJ2dKpzWWiasedbVMKeFBBfB1W5tm2OH7zTMJhJe6IqDkhxNq6MhYfehB8ZC3Uem5QqLWKYFAQt8s97pZBgQTpRXCiz2BZBZCtecMOnwEzJhzcAmcBzQpjX5J9FQlvM6QfDO46Jz6MbDCLZBB10osuiInywsJsTb2jZCwZDZD&pretty=1&since=1595833200&until=1596265200&metric=page_engaged_users",
      "next":"https://graph.facebook.com/v8.0/137088133587412/insights?access_token=EAAKPk7foIPMBAGtZCNNZBPVXyOZA6zzLV4Ni7YagWXDJ2dKpzWWiasedbVMKeFBBfB1W5tm2OH7zTMJhJe6IqDkhxNq6MhYfehB8ZC3Uem5QqLWKYFAQt8s97pZBgQTpRXCiz2BZBZCtecMOnwEzJhzcAmcBzQpjX5J9FQlvM6QfDO46Jz6MbDCLZBB10osuiInywsJsTb2jZCwZDZD&pretty=1&since=1596697200&until=1597129200&metric=page_engaged_users"
   }
}

Values are all zero as the page doesn't have any views as I am testing.

For some reason the data is returned in 3 seperate objects (day, week & 28_days), not sure why its returned like that when i give it a range but thats not the main question at hand.

My understanding of the data returned is that for the first value, the data is for 08/01/2020 (the 1st of august, a Saturday), denoted by "end_time" which is set for the start of 08/02/2020 (the start of 2nd of august, midnight 00:00).

The data returned only includes 5 results, spanning 08/01/2020 - 08/05/2020 (Saturday the 1st of august to Thursday the 5th of august).

I could understand if it only included 6 days (given a 7 day range) as it may be taking the 7th day as the end point, but it stops on the 5th day, needless to say I am extremely confused.

Why don't I have 7 days worth of data or at least 6 days?

I'm clearly not understanding a fundamental concept here.

0

There are 0 answers