This API is under beta. For access, please contact your Meta representative.
Dataset Quality API for offline events provides a breakdown of the score and recommendations by several quality dimensions, including match key coverage, frequency, and freshness. An optimal event setup allows for the collection of high-quality data, which is essential for the ad system's performance.
A high-quality Conversions API multichannel setup will enable advertisers to use omnichannel ads, which is the solution that lets you drive in-store and website sales using one sales campaign.
Partners and agencies may use the Dataset Quality API to provide a quality dashboard and insights, while helping their advertisers to enhance and optimize their integrations. Partners may also use this integration to monitor the stability of their Conversions API integration. Advertisers may use this endpoint to aggregate dataset quality data to incorporate in their monitoring.
You must first request authorization to send events on behalf of your clients. You have the following authentication options:
Facebook Login for Business is the preferred authentication and authorization solution for tech providers and business app developers who need access to their business clients' assets. It allows you to specify the access token type, types of assets, and permissions your app needs, and save it as a set (configuration). You can then present the set to your business clients to complete the flow and grant your app access to their business assets.
With this option, Meta Business Extension (MBE) returns all the necessary information needed to send events on behalf of the client. MBE provides an endpoint to retrieve system user access tokens created in the client’s Business Manager. This process includes permissions to send server events and is done automatically and securely. MBE is currently under beta. Please contact your Meta representative for access.
The endpoint requires a user access token as an input parameter. If you are a new MBE user, call this endpoint to fetch the system user access token after you have finished setting up MBE. Existing users need to ask for re-authentication before calling the new API endpoint.
With this option, the client shares their Meta Pixel to the partner using Business Manager settings or by the API. Then, the partner can assign the partner system user to the client pixel and generate an access token to send server events.
Basic: If you manage a small number of Meta datasets and/or wish to test the Dataset Quality API, then the following app permissions are required: ads_read and (ads_management or business_management).
Advanced: If you manage a high number of Meta datasets on behalf of other businesses and/or require higher rate limits, then the Advanced Level of the ads_management app permission and app feature Ads Management Standard Access is required. Advanced Level app permissions and features require app review.
You can monitor data quality score per offline event, along with match keys being sent, using the following API endpoint, parameters and fields:
Endpoint: https://graph.facebook.com/v23.0/dataset_quality
To get dataset quality metrics for a dataset, make a GET
request to the dataset_quality
endpoint with the following parameters:
Parameter | Description |
---|---|
dataset_id integer | Required. |
access_token string | Required. |
agent_name string | Optional. For example, if your partner_agent value is The If you are an advertiser, most of the time you should not worry about If you do not provide an |
Field | Description |
---|---|
offline array | This field denotes a structured set of data related to offline events. The filter is an array containing |
event_name string | A standard event or custom events. |
composite float | The composite Data Quality Score for the offline events. To calculate the data quality score, we consider factors such as data freshness, frequency and attribution over the last 28 days. These factors, each weighted differently, combine to give a score out of 10. Note: A composite score of 8.5 or higher allows the access to use of omnichannel ads, ensuring ads reach the right audience at the right time. |
match_key integer | The |
frequency integer | The frequency score metric measures how often you send data, recommendation on how to improve the score. It gives a score out of 10. |
freshness integer | The freshness score shows how real time your data is, and shares the recommendations on how to improve the score. |
Graph API Explorer
GET/v24.0
/dataset_quality?dataset_id=<DATASET_ID>&fields=offline
cURL
curl -X GET \ https://graph.facebook.com/v23.0/dataset_quality?dataset_id=<DATASET_ID> \ -F 'agent_name="My Agent Name"'\ -F 'fields="offline"'\ -F 'access_token=<ACCESS_TOKEN>'
Sample Response
{ "offline": [ { "event_name": "Purchase", "composite": { "score": 6.6, "recommendation": "Your offline data quality score is ok, but could be improved." }, "match_key": { "score": 5.6, "recommendation": "Sending email and phone number parameters can help improve your match key score." }, "frequency": { "score": 4.6, "recommendation": "Sharing your offline data more often can help improve your frequency score and help you get better ad outcomes." }, "freshness": { "score": 2.2, "recommendation": "Sending your most recent offline conversion data sooner can help improve your score and help you get better ad outcomes." } } ], }
Scenario: You only want the event names and the composite scores for each event.
Graph API Explorer
GET/v23.0/dataset_quality?dataset_id=<DATASET_ID>&fields=offline{event_name, composite}
Sample Response
{ "offline": [ { "event_name": "Purchase", "composite": { "score": 6.6, "recommendation": "Your offline data quality score is ok, but could be improved." }, } ], }
Scenario: You only want the event names and the match key scores, recommendations, coverages for each event.
Graph API Explorer
GET/v23.0/dataset_quality?dataset_id=<DATASET_ID>&fields=offline{event_name, match_key}
Sample Response
{ "offline": [ { "event_name": "Purchase", "match_key": { "score": 6.6, "recommendation": "Send email and phone parameters to help improve your match key score." }, "coverage" : { "email": 100.0 "phone": 90.0 } } } ] }
The following error codes may be returned when creating a dataset:
Error Code | Description |
---|---|
| The |
| The application doesn’t have permission for this action. |