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!
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
orads_read
permission, you can make a request to the Marketing API such asThis will give you the
effective_object_story_id
which is theobject_id
of the post ({page_id}_{post_id}
), and its insights including its actions broken down by action type. For example:The
effective_object_story_id
(so, post_id) is456000000_789000000
.You can then query the
comments
edge of the post addingsummary=true
as a parameter. This endpoint is public for common posts (however, it won't work for non public posts)Which will respond with an object like
This means the post has had 50 comments, of which 12 were made through a paid action.
We can simply use this syntax to get adset comment: ...adset_id/insights?fields=actions. Another ads stuffs are the same