Facebook post impressions are null in FQL stream query

…衆ロ難τιáo~ 提交于 2020-01-31 10:39:20

问题


According to the FQL Stream documentation the following query is supposed to return impression counts when run by an authenticated page owner, yet it never does. We have the page owner authenticating directly in the graph api explorer with extended permissions (read_stream, read_insights), but the impression counts are always null.

Is anyone able to get this working?

SELECT post_id, actor_id, message, impressions FROM stream WHERE actor_id = {owned_page} and source_id = {owned_page}

回答1:


I think its missing in the documentation, but you should make this call using the page access token instead of user access token to get it worked.

So here are the steps:

  1. Get the following permissions from the user and get the user access_token:

    • manage_pages - to get the page access token
    • read_insights - to read the impressions (as mentioned in the doc)
    • read_stream - for all posts that the current session user is able to view

  2. Using that token, get the page access_token with the call-

    /{page-id}?fields=access_token

  3. (optional) Check out my answer here to extend this page access token that will never expire. (Basically to avoid some steps)

  4. Using the page access token, run your query-

    SELECT post_id, actor_id, message, impressions FROM stream WHERE actor_id = {owned_page} and source_id = {owned_page}

    This will fetch you the impressions(if any) in the result.

Hope that helps.!



来源:https://stackoverflow.com/questions/11451815/facebook-post-impressions-are-null-in-fql-stream-query

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