This guide shows you how to implement the Audience Network Reporting API version 2 (v2) to get performance data for your business.
read_audience_network_insights
permission
Query impressions and revenue for the placement on 1-4 May 2022 with a daily breakdown.
What might change: You may see that some data is unavailable following the change.
The revenue and CPM data points that are not available due to insufficient number of impressions will not be included in the results
field in the API response. Instead, the corresponding entries will be added to the omitted_results
field. They will include the time, metric and breakdowns fields, but they will not include the value - please refer to the sample response at the bottom of this page.
Use the GET ID > adnetworkanalytics endpoint to get audience network insights for a business, property, or app.
GET /<ID>/adnetworkanalytics
To get insights, send a GET
request to the /<ID>/adnetworkanalytics
endpoint with a comma-separated list of metrics and optional comma-separated list of breakdowns where <ID>
is your Meta business ID, property ID, or app ID. The following example gets metrics over a single 24 hour period and limiting the results to 2 responses per metric.
curl -X GET https://graph.facebook.com/v21.0
/BUSINESS_ID/adnetworkanalytics
?metrics=["fb_ad_network_request","fb_ad_network_imp","fb_ad_network_click","fb_ad_network_revenue"]
&breakdowns=["placement","country"]
&since=2021-08-06
&until=2021-08-06
&limit=2
{ "data": [ { "query_id": "531234567890123456789012345683d6", "results": [ { "time": "2021-08-06T07:00:00+0000", "metric": "fb_ad_network_imp", "breakdowns": [ { "key": "placement", "value": "123456789012345" }, { "key": "country", "value": "AE" } ], "value": "1200" }, { "time": "2021-08-06T07:00:00+0000", "metric": "fb_ad_network_imp", "breakdowns": [ { "key": "placement", "value": "123456789012345" }, { "key": "country", "value": "AU" } ], "value": "35" }, { "time": "2021-08-06T07:00:00+0000", "metric": "fb_ad_network_revenue", "breakdowns": [ { "key": "placement", "value": "123456789012345" }, { "key": "country", "value": "AE" } ], "value": "21.212345" }, { "time": "2021-08-06T07:00:00+0000", "metric": "fb_ad_network_request", "breakdowns": [ { "key": "placement", "value": "123456789012345" }, { "key": "country", "value": "AD" } ], "value": "1" }, { "time": "2021-08-06T07:00:00+0000", "metric": "fb_ad_network_request", "breakdowns": [ { "key": "placement", "value": "123456789012345" }, { "key": "country", "value": "AE" } ], "value": "12" }, { "time": "2021-08-06T07:00:00+0000", "metric": "fb_ad_network_click", "breakdowns": [ { "key": "placement", "value": "123456789012345" }, { "key": "country", "value": "AE" } ], "value": "1" }, { "time": "2021-08-06T07:00:00+0000", "metric": "fb_ad_network_click", "breakdowns": [ { "key": "placement", "value": "123456789012345" }, { "key": "country", "value": "CA" } ], "value": "2" } ], "omitted_results": [ { "time": "2021-08-06T07:00:00+0000", "metric": "fb_ad_network_revenue", "breakdowns": [ { "key": "placement", "value": "123456789012345" }, { "key": "country", "value": "AU" } ] } ] } ], "paging": { "cursors": { "before": "MAZDZD", "after": "MQZDZD" }, "next": "https://graph.facebook.com/v10.0/142440604406900/adnetworkanalytics?access_token=<ACCESS_TOKEN>&since=2021-08-06&until=2021-08-06&breakdowns=%5B%22placement%22%2C%22country%22%5D&limit=2&metrics=%5B%22fb_ad_network_request%22%2C%22fb_ad_network_imp%22%2C%22fb_ad_network_click%22%2C%22fb_ad_network_revenue%22%5D&after=MQZDZD" } }
Parameter | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Aggregate results by | ||||||||||||||||||
|
Syncronous requests have no limits on the number of breakdowns that can be included.
| ||||||||||||||||||
|
Further filter responses to get more specific results. The
| ||||||||||||||||||
|
The number of rows to return. Limitations: Syncronous requests have a maximum limit of 2,000. | ||||||||||||||||||
| Required.
At least one metric is required but there are no limits on the number of metrics that can be included in a request. | ||||||||||||||||||
|
Order by the results by time or value. Defaults to | ||||||||||||||||||
|
Defaults to | ||||||||||||||||||
|
The starting limit of the query (always inclusive). Defaults to past 7 days if not included. Limitations:
| ||||||||||||||||||
|
The ending limit of the query (exclusive by default, inclusive for hourly aggregations) |
Metric | Description |
---|---|
| Rate of bid responses |
| Number of bid requests |
| Number of bid responses |
| Rate of auction wins by the bidder |
| Number of clicks |
| Effective CPM (eCPM) |
| Estimated click rate |
| Rate of filled ad requests |
| Number of filled ad requests |
| Number of impressions |
| Count of top no response bid reasons Available only when used as a single metric |
| Count of top no-fill reasons Available only when used as a single metric |
| Ad requests |
| Estimated revenue |
| Impressions divided by Filled |
Use the Access Token Debugger to get detailed information for an access token, including permissions, validity, property access, and App ID associated with the token.
Error Message / Issue | Resolution |
---|---|
Expired Token | For best user experience, use Long-Lived Access Tokens |
“Facebook has detected that [your app] isn't using a secure connection to transfer information error when using | Ensure that your Business has been onboarded in Monetization Manager and you have created at least one property. |
"Reading insights of a Page, business, app, domain or event source group not owned by the querying user or application." | Review Business Settings to make sure that you are requesting data owned by the Business that you are querying for. |
"Unsupported | Review the property to make sure that you are requesting data for a property you own. |
"The way to access reporting API v2.0 has changed. You now need to implement Facebook Login for your app to access this API. See instructions here: https://developers.facebook.com/docs/facebook-login/" | You have tried to query the Reporting API v2 with the System User token. Use Facebook Login to make queries, or revert to v1 (but you will need to implement Facebook Login anyway in the future). |
"Bad arg: All applications should have a property" | Ensure that your Business has been onboarded in Monetization Manager and you have created at least one property. |
""Please reduce the amount of data you're asking for, then retry your request." |
|
"You can have at most 250 queries per minute" | Reporting API V2 allows requests with multiple parameters and the use of pagination. Please look into ways of using less API requests where possible. |