I am have some difficulty extending my API query to only include specific actions. I can run the following query just fine:
https://graph.facebook.com/v2.10/act_11111111111111111/ads?fields=name,insights{actions.filtering("action_type":comment)}&limit=1
…but the results contain more action types than desired.
"data": [
{
"name": "Test Name",
"insights": {
"data": [
{
"actions": [
{
"action_type": "comment",
"value": "2"
},
{
"action_type": "link_click",
"value": "142"
},
{
"action_type": "post_reaction",
"value": "16"
},
{
"action_type": "video_view",
"value": "630"
},
{
"action_type": "page_engagement",
"value": "790"
},
{
"action_type": "post_engagement",
"value": "790"
}
],
"date_start": "2017-08-26",
"date_stop": "2017-09-24"
}
],
I’m looking to only return ‘comment’ and ‘link_click’, something along the lines of…
https://graph.facebook.com/v2.10/act_11111111111111111/ads?fields=name,insights{actions?action_type=comment,link_click}&limit=1
Thank you!
2
Answers
Try This
This Graph URI is only for single ads not an ad accounts level but you can set your logic similar like below
You can ask for all ads in ad account: