Get metrics from Facebook Ads API

别等时光非礼了梦想. 提交于 2019-12-30 05:20:07

问题


I am not able get the below metrics from Facebook API. How can I calculate the these metrics, which appear in Facebook's own ads interface, from the Facebook Ads API:

  • Reach
  • Social reach
  • Frequency,
  • CPC,
  • CPM.

回答1:


When you have the Ad group ID, you have to issue an API call: https://graph.facebook.com/<AD-GROUP_ID>/stats

Then you get answer like this:

{
  "id": "<AD-GROUP_ID>/stats/0/.....", 
  "impressions": 31, 
  "clicks": 0, 
  "spent": 0, 
  "social_impressions": 0, 
  "social_clicks": 0, 
  "social_spent": 0, 
  "unique_impressions": 0, 
  "social_unique_impressions": 0, 
  "unique_clicks": 0, 
  "social_unique_clicks": 0, 
  "actions": 0, 
  "connections": 0, 
  "adgroup_id": 6003713142141, 
  "start_time": null, 
  "end_time": "2011-11-07T06:43:21+0000"
}

To calculate the fields in the Facebook frontend:

'Reach' = unique_impressions
'Social Reach' = is called social_unique_impressions.
'Frequency' = impressions / unique_impressions
'CPC' = spent / clicks
'CPM' = (spent * 1000) / impressions



来源:https://stackoverflow.com/questions/7429557/get-metrics-from-facebook-ads-api

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