Is facebook insights using graph API working right now?

▼魔方 西西 提交于 2019-12-10 15:06:06

问题


I would like to use graph API to get page and app insights without Facebook JS SDK. I tried the following:

  • I created an app with user A
  • I log in to that app using the following url with user B (user B is admin of pages and apps)

https://m.facebook.com/dialog/oauth?client_id=[appID]&redirect_uri=[uri]&scope=read_insights,manage_pages&response_type=token

  • Using the above url, login was ok, I got the access token
  • Using https://graph.facebook.com/me/accounts I got the list of apps and pages
  • Finally I try to query insights values with the following url https://graph.facebook.com/[page id]/insights&access_token=[login_response_access_token] but I got the following empty result:

{ "data": [ ], "paging": { "previous": "https://graph.facebook.com/[page_id]/insights?format=json&since=1329064393&until=1329323593", "next": "https://graph.facebook.com/[page_id]/insights?format=json&since=1329582793&until=1329841993" } }

What wrong with my steps? I tried to use Graph API Explorer and I cannot get insights values from the following url:

https://developers.facebook.com/tools/explorer

  1. Open above url
  2. Get access token (read_insights, manage_pages)
  3. https://graph.facebook.com/[page_id]/insights returns same empty JSON

回答1:


your first and second steps are true but the third one is wrong because in the url https://graph.facebook.com/[page_id]/insight there is no insight field on the node of your page_id like everyone I think. You can see the fields you are able to use on the right side of the Graph explorer.

May be the reason of the emptiness of insights could be FB.api returns empty datas for some days nowadays. you can test it by clicking show old insights in the page of your app. you will see.




回答2:


I'm presuming you have the correct access_token (which is probably the case given you ability to query the objectids). Does the objectid in question have data in the last month? Also, I would recommend supplying a date range (with the since and until parameters), this has caused me issues in the past.



来源:https://stackoverflow.com/questions/9365063/is-facebook-insights-using-graph-api-working-right-now

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!