Get metrics from the Facebook Ads API

I cannot get the following metrics from the Facebook API. How can I calculate these metrics that appear in the Facebook native ads interface from the Facebook ads API:

  • Reach
  • Social reach
  • Frequency
  • CPC
  • CPM
+4
source share
1 answer

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

Then you will get the answer as follows:

 { "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 interface:

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

+9
source

All Articles