Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to access a post's insights for someone else's page

When I access this resource:

https://graph.facebook.com/xxx_yyy/insights

I get this response:

{
  "data": [
  ], 
  "paging": {
    "previous": "https://graph.facebook.com/xxx_yyy/insights?format=json&since=-86400&until=0", 
    "next": "https://graph.facebook.com/xxx_yyy/insights?format=json&since=0&until=86400"
  }
}

The insights data is empty. "xxx_yyy" is a valid post id I got from the feed.

  • I have the read_insights permission.
  • I have the offline_access permission.
  • I'm an admin on the page.
  • The page has more than 30 likes.

What's causing the API to return an empty insights array?

like image 381
Scott Brady Avatar asked Feb 22 '23 07:02

Scott Brady


1 Answers

There are a few requirements for you to get data back from the Facebook Insights graph API call. These don't appear to be clearly documented anywhere, but this is what I have found by trial and error.

  • The post must be from the page itself, posts from other people won't return insights data
    • Look at the id in the From object within the post response from facebook, if that is different than the page_id, you won't get metrics.
    • It's good to note that I haven't unequivocally proved this point, just some anecdotal testing seems to point in this direction
  • The post must be quite old, I was able to dig up something on one of their Ads FAQs that post insights won't be available for 12-15 hours after the end of the day they were posted on.

    "Page post metrics will be available 12 to 15 hours after the end of the day the post was made. Metrics are logged on Pacific Standard Time." Page Post Metrics FAQ -Ads and Business Solutions

    • I have yet to determine the exact age that posts need to be precisely, but my guess is 36 hours would be a safe general bet. That being said, Facebook Insights data has been known to fall behind from time to time, so I would assume that the timing with which you can attain data will be variable.

FB documentation on page post insights is available primarily in this Facebook blog post

like image 172
Georg Schölly Avatar answered Mar 05 '23 05:03

Georg Schölly