Facebook Marketing API get total reach of multiple Ad Sets

倖福魔咒の 提交于 2019-12-06 09:57:47

问题


I am trying to use the Marketing API to get the summary data for multiple Ad Sets.

I am able to get the data for each Ad Set with the following:

insights/?ids=[**ad_set_ids**]&fields=impressions,clicks,reach,actions,total_actions

I can add up the numbers for each Ad Set to get the total and it is fine except for "reach" because the total of reach doesn't just add up to the total (see image below).

Is there any way to get the summary of data for the ad sets (the last row in the image "Results from 3 Ad Sets")?

I also tried to add the param default_summary=true but it gives me the summary for each ad set instead of the sum of all ad sets.


回答1:


What you actually need to use the summary field to achieve this. For example you can query your insights at ad account level and then specify level=adset. Then in the filterring, you specify a list of adset.id. And very important you should add summary=["reach"], so that you can get aggregated reach.

Here is an example:

https://graph.facebook.com/act_[acc_id]/insights?limit=5000&level=adset&summary=["reach"]&date_preset=lifetime&action_attribution_windows=["default"]&filtering=[{"field":"adset.id","operator":"IN","value":[adsetID1]"[","[adsetID2]"]}]

And actually you can do this on a campaign node instead of adaccount node too. It may give you better performance.



来源:https://stackoverflow.com/questions/39990160/facebook-marketing-api-get-total-reach-of-multiple-ad-sets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!