Choose a guide
Custom Audience delivery
Upload hashed identifiers and deliver them into a new or existing Custom Audience in one ad account.
Conversion events
Send offline conversion events to a Meta dataset through the Conversions API, starting with test events.
Prerequisites
What you need depends on the guide you follow:API key
Create the key under Settings → API Keys with read and write ondatasets, uploads, connections, and installations, and read on jobs. Add webhooks if you want delivery notifications. See API Keys for the procedure and the Permissions Reference for what each resource covers.
Create it from a shared team account rather than a personal login, so the integration keeps working when someone changes roles.
Facebook Connector installed
The Facebook Connector is app8. Find your installation of it:
"app_id": 8, install the Facebook Connector from the Narrative Marketplace.
A connected Meta profile
A connector profile holds the Meta credentials that every delivery uses. You create it once per Meta business, in the Narrative UI:1
Open the connector
In Narrative, go to Installed Apps and select Facebook Connector.
2
Choose a profile type
Choose System user for an integration. With a system-user profile, you name the ad account on each connection.
3
Sign in to Meta
Sign in to Meta in the popup and grant Narrative access to your business.
An eligible ad account
Custom Audiences go into an ad account that belongs to a Business Manager and has accepted Meta’s Custom Audience terms. List your ad accounts shows both. See Ad Account Eligibility for Custom Audiences to fix an account that does not qualify.A Meta dataset ID
Conversion events go to a Meta dataset, which Events Manager also calls a pixel. Its numeric ID is on the dataset’s page in Events Manager, and List your Meta datasets returns it.Set up API access
The guides talk to two hosts, and each takes its own credential:Get an installation token
The Meta connector authenticates requests with an installation token, which you get by exchanging your API key. Use the installation ID from Facebook Connector installed:access_token as $INSTALLATION_TOKEN. It lasts about three hours, so request a new one at the start of each run of your integration.
Confirm that both hosts answer:
api.narrative.io and the installation token to facebook.narrativeconnectors.com.
Find your profile
GET /profiles lists every Meta profile in your company. To read one:
status is enabled and whose token.is_valid is true. Record its id.
List your ad accounts
supports_custom_audiences and user_accepted_custom_audience_tos are true. Keep the act_ prefix when you use the ID.
List your Meta datasets
id is a number. Conversion events carry it in meta_dataset_id.
Delivery notifications
The Facebook Connector reports each delivery as an app webhook event. Subscribe a webhook to app8 to receive them:
secret to verify each delivery. The connector sends these events:
To stop the notifications, delete the subscription with
DELETE /webhooks/{webhook_id}. See App subscription for the subscription fields and Verifying deliveries for checking the secret.
Related content
Meta Custom Audiences Connector
Supported identifiers and audience membership duration
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

