Get comments from facebook ads (marketing)

我与影子孤独终老i 提交于 2019-12-20 03:30:08

问题


After I make an ads for my post on facebook ads manager. Facebook Ads Manager show me how many comment belong to this ads. This is very important for me to verify the effective of my campaign.

In programing aspect: Is there's any way to count number belong to my ads like Facebook Ads Manager (I describe above). I have used both Java Facebook Ads SDK (Ads Insight module from https://github.com/facebook/facebook-java-ads-sdk) and Graph Explorer Tool, they both return "comment" field or "like" field not existed Please help!


回答1:


You can't get comments nor reactions from Marketing Insights directly.

I stand corrected. If you have access to an ad_account insights, then you can use Marketing API to get a post's comments directly. Thanks @lamxung55

Let's say you have and ad_id of 123000000

If you have a token with ads_management or ads_read permission, you can make a request to the Marketing API such as

/123000000?fields=creative.fields(effective_object_story_id),insights.fields(actions)

This will give you the effective_object_story_id which is the object_id of the post ({page_id}_{post_id}), and its insights including its actions broken down by action type. For example:

{
  "creative": {
    "effective_object_story_id": "456000000_789000000",
    "id": "123000000"
  },
  "insights": {
    "data": [
      {
        "actions": [
          {
            "action_type": "comment",
            "value": "12"
          },
          {
            "action_type": "like",
            "value": "2"
          },
          {
            "action_type": "post",
            "value": "3"
          },
          {
            "action_type": "post_reaction",
            "value": "29"
          },
          {
            "action_type": "video_view",
            "value": "558"
          },
          {
            "action_type": "page_engagement",
            "value": "604"
          },
          {
            "action_type": "post_engagement",
            "value": "602"
          }
        ],
        "date_start": "2017-08-14",
        "date_stop": "2017-08-20"
      }
    ],
    "paging": {
      "cursors": {
        "before": "xxx",
        "after": "xxx"
      }
    }
  }
}

The effective_object_story_id (so, post_id) is 456000000_789000000.

You can then query the comments edge of the post adding summary=true as a parameter. This endpoint is public for common posts (however, it won't work for non public posts)

/456000000_789000000/comments?summary=true

Which will respond with an object like

{
  "data": [
     <LOTS OF COMMENTS HERE>
  ],
  "paging": {
    <PAGING LINKS>
  },
  "summary": {
    "order": "chronological",
    "total_count": 50,
    "can_comment": true
  }
}

This means the post has had 50 comments, of which 12 were made through a paid action.




回答2:


We can simply use this syntax to get adset comment: ...adset_id/insights?fields=actions. Another ads stuffs are the same



来源:https://stackoverflow.com/questions/44931380/get-comments-from-facebook-ads-marketing

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