1. Create the dataset
A conversion-event dataset needs two columns:meta_conversion_event, an object holding the event- at least one identifier Meta can match on, such as
sha256_hashed_email
id in the response, then activate the dataset:
Required columns
Themeta_conversion_event column is an object. These properties are required in every event:
The optional properties are
source_url, opt_out, data_processing_options, data_processing_options_country, data_processing_options_state, custom_data, and store_data. The meta_conversion_event attribute gives the type of each one and the fields inside custom_data and store_data. Add the ones you use to the schema before you activate it, because activation locks the schema.
The dataset also needs at least one of these identifier columns:
Each identifier column is named after its Rosetta Stone attribute, and the connector matches on that column name. A column holds either a plain string or an object. In the dataset schema, declare a string column with
"type": "string", and declare an object column with "type": "object" and its properties:
2. Confirm Meta accepts the dataset
Before you create a connection, ask Narrative which connector interfaces the dataset satisfies:acceptedlists each interface you can connect the dataset to, by the connector’sapp_idand theinterface_id.errorslists each interface the schema does not satisfy. Itsdetailshold the reason, such as"required property '<column>' not found".
?tags=<tag> to check only the interfaces that carry that tag.
When the interface you want is under errors, the dataset’s schema doesn’t meet what the interface needs, for example a missing column or property. Activation locks the schema, so create a new dataset that fixes what the error names.
For Meta conversion events, add ?tags=capi and look for "app_id": 8 with conversion_events in accepted:
3. Get a test event code
Send test events first, so you can watch them arrive before they count as real conversions:1
Open the dataset in Events Manager
In Meta Events Manager, open the dataset you are sending to and choose Test events.
2
Choose the channel
Select the Offline channel and expand Confirm your server’s events are set up correctly.
3
Copy the code
Copy the test event code Meta shows, which starts with
TEST. Keep the tab open while you test.4. Create the connection
meta_dataset_id, so one connection can send to every Meta dataset the profile can reach.
What the connection does describes test_event_code, historical_data_enabled, and their defaults.
5. Upload events
Each line of the file is one event, in a row that matches the schema you declared in step 1.event_name takes the lowercase names listed in Event names, such as purchase. Offline events use physical_store as source. For the columns Meta accepts and their shapes, see The meta_conversion_event attribute, Supported user identifiers, and Required columns.
You can load a file into a dataset over the API in two ways:
- Signed-URL upload. Your integration uploads one file of up to 3 GB, then asks Narrative to ingest it.
- Managed S3 bucket. You write files to an S3 bucket that Narrative manages, and Narrative ingests each batch on its own. Use a managed bucket for files larger than 3 GB, or for files that another system delivers on a schedule.
Choose a file format
The dataset’sfile_config.type sets the format of every file you load into it. Parquet and JSON Lines both hold object columns, which nest properties inside one column:
- Parquet (
parquet) is the most compatible format for connector datasets. It stores nested struct columns and their types natively, and Narrative matches columns to the schema by name at every level. - JSON Lines (
json) holds one JSON object per line. Narrative matches each nested object to the schema by name.
flat) hold only scalar columns, so they can’t carry object columns.
Upload a file with a signed URL
Request an upload URL, then send the file straight to storage:PUT.
Then ingest the file into the dataset, passing that path as source_file:
Write files to a managed S3 bucket
A managed bucket is an S3 bucket that Narrative creates for your company. You write each batch of files into its own folder under the dataset’s path in the bucket, then write an empty_NIO_COMMIT file into that batch folder. Narrative ingests every file in the batch folder when the commit file appears, so you make no upload or ingest request. A file can be as large as S3 accepts.
See Ingesting Files from a Managed S3 Bucket to create the bucket, grant your AWS account access, and lay out the folders.
6. Check the events at Meta
Watch the Test events tab you left open. Within a few minutes each event appears with its event name (for example Purchase), status Processed, and Server as where it was received from. Expand an event to see its value, currency,order_id, action source, and the user data keys Meta matched on, such as Email.
To hear about deliveries in your integration, subscribe to delivery notifications.
Going live
When the test events look right, send real conversions:- Create a connection on the dataset with the same request as step 4, leaving out
test_event_code. - Delete the test connection with
DELETE /v2/connections/{connection_id}.
Keeping events flowing
Write new events to the dataset. The connection keeps running, so new rows reach Meta without further calls. Meta accepts offline events up to 90 days old and other events up to 7 days old. See Event age limits.Stopping delivery
Troubleshooting
Getting help
Contact your Narrative relationship manager with your company ID, the dataset ID, and the failing request and response.Related content
Delivering Custom Audiences via the API
Deliver hashed identifiers into a Custom Audience
Meta Conversions API Connector
Every
meta_conversion_event field, event name, and action sourceConnector Interfaces
Why a dataset connects to an interface rather than a connector
API Keys
Create and rotate keys for programmatic access

