Facebook Marketing API: Is it possible to filter insights by status

Digital Marketing Facebook Marketing API 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
_x000D_ _x000D_ I am trying to filter adsets insights by adset status, but when I add a status filter, I get an empty dataset back: curl "https://graph.facebook.com/v2.7/act_/insights?fields=clicks,impressions,cpc,ctr,account_id&time_range%5Bsince%5D=2016-01-12&time_range%5Buntil%5D=2016-09-12&access_token=&format=json&filtering=%5B%7B%22field%22:%22status%22,%22operator%22:%22EQUAL%22,%22value%22:%22ACTIVE%22%7D%5D&level=adset" here is what filtering param looks like before it gets url-encoded: [{"field":"status","operator":"EQUAL","value":"ACTIVE"}] I have tried all valid values for status ACTIVE, PAUSED, DELETED, ARCHIVED to no avail. When I remove filtering param - I see my data. The question is: Does anyone know if it is possible to filter by status, and if it is, what I am doing wrong?

Posted on 16 Aug 2022, this text provides information on Facebook Marketing API related to Digital Marketing. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago
_x000D_ It is possible. Using latest version as of March 2018. You need to actually request all the ads that are ACTIVE and then provide insights as a 'nested' list of fields. Replace 123456 with your ad account (but leave the 'act_' which is needed) act_123456/ads?fields=effective_status,name,insights{total_action_value,total_actions,actions},adset_id,campaign_id&filtering=[{'field':'effective_status','operator':'IN','value':['ACTIVE']}] This also works for /campaigns and /adsets You can also do this (be sure to include &level=ad): act_123456/insights?fields=ad_id,adset_id,campaign_name,action_values,campaign_id,total_action_value&level=ad&filtering=[{"field":"campaign.delivery_info","operator":"IN","value":["active"]}]

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.