facebook-graph-apifacebook-marketing-api

How to get Campaign Summary in Facebook Graph API


I am trying to get the summary from multiple campaigns from the facebook graph api. I already managed to get a filtered view, so i just get the Campaigns i need:

I am able to get the reach and impression data by platform for every Campaign, but if i sum it up, its not the same result as marked in the screenshot.

https://graph.facebook.com/v14.0/act_BUSINESS_ID/campaigns?fields=name,id,status,objective,insights{impressions}&filtering=[{field: "id",operator:"IN", value: ['CAMPAIGN_ID1"','CAMPAIGN_ID2"']}]

Is it possible to get the reach and impression Data as a summary and breakdowned by platform like in the Screenshot?

enter image description here


Solution

  • So, finally i got the right way!

    The call should look like this:

    act_Accunt_id/insights?breakdowns=publisher_platform&fields=ad_id,clicks,unique_clicks,cpm,impressions,reach,spend&default_summary=true&date_preset=maximum&filtering=[{field: "campaign.id",operator:"IN", value: ['ID1','ID2']},{"field":"publisher_platform","operator":"CONTAIN","value":"facebook"}]
    

    I just came up with also filtering by publisher_platform and thats it!

    You can filter any campaign field and as long, as you set the default_summary and the date_preset values correctly, the numbers are exact.