bitterleaves
bitterleaves

Reputation: 33

Why can't I retrieve Facebook post insights metrics via Page Insights API?

I am testing out the results of various metrics in the Page Insights list. I am approved for the required permissions (read_insights, pages_read_engagement) plus a few others. However, only the metrics about the page itself seem to work, and not the ones about the page posts. I can't for the life of me figure out why no data is being returned.

For example:

I am trying, in the Graph API Explorer:

{page-id}/insights?&metric={metrics}

And I get responses for page metrics but not for post metrics. Post metrics return something like:

{
  "data": [
  ],
  "paging": {
    "previous": "https://graph.facebook.com/v15.0/101850586311/insights?access_token={token}&pretty=0&metric=post_impressions&since=1664002800&until=1664175600",
    "next": "https://graph.facebook.com/v15.0/101850586311/insights?access_token={token}&pretty=0&metric=post_impressions&since=1664348400&until=1664521200"
  }
}

How can I get responses for the post metrics (engagement, impressions, reactions)? Am I missing something -- the right access token, Tasks, etc.?

Upvotes: 1

Views: 1090

Answers (1)

jason
jason

Reputation: 36

{object-id}/insights?&metric={metrics}

The point is at {object-id} If the metric is page_xxxx, then the object-id is page id And if the metric is post_xxx, then the object-id is post id

For example

250822055038923/insights/page_consumptions_unique The id is page id and the metric is about page insight

5500818833372526/insights/post_activity_by_action_type The id now is post id and the metric is about post insight

Upvotes: 2

Related Questions