ttps://graph.facebook.com/v14.0/act_XXXXXX/insights?fields=account_name,campaign_id,campaign_name,adset_id,adset_name,ad_id,ad_name,spend,actions&filtering=[{field: "action_type",operator:"IN", value['link_click','page_engagement','post_engagement']}]&access_token=XXXXXX
I'm trying the above Graph API CURL: For getting the overall post engagement, page Engagement, and Link Clicks, for this account. Can you please help?
"{ "data": [ { "account_name": "ABCD", "spend": "232", "actions": [ { "action_type": "link_click", "value": "5962" }, { "action_type": "page_engagement", "value": "26525" }, { "action_type": "post_engagement", "value": "26525" } ], "date_start": "2022-07-27", "date_stop": "2022-08-25" } ], "paging": { "cursors": { "before": "xxxx", "after": "xxxx" } } }'
Use level
as parameter to Insights API for getting data at required levels.
Supported levels:
Example for fetching data at campaign level -
https://graph.facebook.com/v14.0/act_XXXXXX/insights?
fields=account_name,campaign_id,campaign_name,adset_id,adset_name,ad_id,ad_name,spend,actions&
filtering=[{"field": "action_type",operator:"IN", "value":["link_click","page_engagement","post_engagement"]}]&
level=campaign
Reference: https://developers.facebook.com/docs/marketing-api/insights/#levels