Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get insights data of facebook page

I want to get insights data of a facebook page. I have tried with graph api with this url:

https://graph.facebook.com/149279625121774/insights/?access_token=XXXX

but it gives empty data:

{    "data": [
          ],    "paging": {
      "previous": "https://graph.facebook.com/149279625121774/insights/...",
      "next": "https://graph.facebook.com/149279625121774/insights/..." 
     } 
}

'149279625121774' is the page id.

Is anybody help me for this.

like image 212
Chirayu Avatar asked Jan 27 '11 09:01

Chirayu


2 Answers

UPDATED ANSWER:
Insights can be retrieved only as an array. To read Insights you need

  • a generic access_token for the publicly available application_active_users metric
  • a generic app access_token for all Insights for that app
  • read_insights permissions for all apps, pages and domains owned by this user

For more details on which insights are available please review the FQL Insights table


Here are my comments:

  1. Most likely you don't have the read_insights permission.
  2. The user authenticated should be the owner/admin of the page!
  3. Remove the trailing slash /
like image 163
ifaour Avatar answered Nov 16 '22 02:11

ifaour


I found the solution.

You must change the order of the scope parameter:

Try

email,read_insights,manage_pages

Instead of

email,manage_pages,read_insights
like image 26
helpse Avatar answered Nov 16 '22 03:11

helpse