Dataset Quality API for Offline Events

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.

Common Use Cases

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.

Setup Requirements

Ownership and Access

Advertiser Authentication Using Business Manager

  1. In Business Manager, go to the Users section and select the System User tab. Click on the specific system user you are using for the Conversions API.
  2. Go to the Assign Asset dialog and choose Pixels. Then, select the pixels you want to send events on behalf of.
  3. For each pixel, select the Manage Pixel permission, and click Save Changes.
  4. Go back to your system user's details page. Verify that the selected pixels are visible there.
  5. To generate the access token, follow instructions here.

Partner Platform Authentication

You must first request authorization to send events on behalf of your clients. You have the following authentication options:

Facebook Login for Business (Recommended)

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.

Meta Business Extension (Recommended)

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.

Client Sharing of a Meta Pixel to Partner’s Business Manager

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.

User Permission

  • The user or system user used to make the API call requires (at minimum) the following user permission: Partial access -> Use events dataset
  • User access may be granted (in bulk) by using the instructions provided here.

App Permission

  • 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.

Retrieving Quality Information for Offline Events

You can monitor data quality score per offline event, along with match keys being sent, using the following API endpoint, parameters and fields:

API Call

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:

Parameters

ParameterDescription
dataset_id
integer

Required.
The ID of dataset (Pixel) to retrieve quality data.

access_token
string

Required.
Valid (unexpired) access token for given dataset (Pixel) ID. We recommend setting up a long-lived system user access token. Read more about different types of access tokens in our dedicated guide.

agent_name
string

Optional.
The normalized value of the partner_agent field is used to filter only events sent with partner_agent param in /{pixel_id}/events POST request (see attributing your events best practices here and here).

For example, if your partner_agent value is [partner_name]_[majorversion]_[minorVersion], your normalized agent string value will be partner_name in lowercase.

The agent_name allows you to set your own platform identifier when sending events on behalf of a client. If you are a managed partner/agency, work with your Meta representative to agree on an identifier for your platform.

If you are an advertiser, most of the time you should not worry about agent_name attribution.

If you do not provide an agent_name, all events regardless of whether they were sent by an agent or not, will be included in the EMQ calculation.

Fields

FieldDescription
offline
array

This field denotes a structured set of data related to offline events. The filter is an array containing event_name and its metrics. This field is required by default in this API. See example section.

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 match_key score provides recommendations on how to improve that score and also the match key coverage for both email and phone. It gives a score out of 10.

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.

Example

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."       }     }   ], }   

Example

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."       },     }   ], }   

Example

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                }         }     }   ] }   

Error Codes

The following error codes may be returned when creating a dataset:

Error CodeDescription

2044055

The dataset_id that was inputted doesn't exist.

10

The application doesn’t have permission for this action.