Choose a guide
Audience delivery
Upload hashed identifiers and deliver them into a new TikTok audience, or into one that already exists.
Conversion events
Send offline conversion events, such as in-store purchases, to a TikTok Offline Event Set.
Prerequisites
What you need depends on the guide you follow:API key
Create the key under Settings → API Keys with read and write ondatasets and connections, write on uploads, and read on installations. Add read and write on 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.
TikTok Connector installed
The TikTok Connector is app19. Find your installation of it:
"app_id": 19, install the TikTok Connector from the Narrative Marketplace.
A profile connected to TikTok
A connector profile holds the TikTok for Business authorization that every delivery uses. The profile also decides which TikTok advertisers you can deliver to. Create the profile once, in the Narrative UI:1
Open the connector
In Narrative, go to Installed Apps and select TikTok Connector.
2
Create a profile
In the Profiles tab, create a profile and give it a name.
3
Connect to TikTok
Choose Connect, sign in to TikTok for Business as someone with access to the advertisers you want to deliver to, select those advertisers, and approve the access request.
url in a browser before expires_at, which is 24 hours after the request. Sign in to TikTok for Business, select the advertisers, and approve. TikTok then sends the browser to the TikTok connector, which saves the authorization and returns an empty page. To confirm the profile is connected, list its advertisers.
You connect a profile once. The profile can then deliver to every advertiser you selected, from any number of connections.
An Offline Event Set ID
Conversion events go to an Offline Event Set in TikTok Events Manager. Create one there for the advertiser that should receive the events, and copy its ID. Each event row you upload carries this ID.Set up API access
The guides talk to two hosts, and each takes its own credential:Get an installation token
The TikTok connector authenticates requests with an installation token, which you get by exchanging your API key. Use the installation ID from TikTok 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 tiktok.narrativeconnectors.com.
Find your profile
GET /profiles lists every TikTok profile in your company. To read one:
status is enabled. Record its id.
List your advertisers
Advertisers are the TikTok advertiser accounts the profile can deliver to, which are the ones selected when the profile was connected:id of the advertiser you deliver to.
List the audiences in an advertiser
total_page is more than 1, request the next page. The audience delivery guide uses this list to find audience IDs.
What the connection does
A connection’squick_settings pick the interface and set how the connection delivers. The fields depend on the interface.
Audiences (audience_first_party)
One interface covers new and existing audiences. Set create_new_for, existing_audiences, or both.
An advertiser can appear in
create_new_for or in existing_audiences, not in both. The connector creates new audiences on the connection’s first delivery and reuses them for every delivery after that.
Conversion events (conversion_events)
Each event names its event set in
tiktok_conversion_event.event_set_id, so the connection has no advertiser or event set setting. The connection sends events up to 90 days old that carry an email address or a phone number.
Existing and new rows
A connection delivers every snapshot written to the dataset after the connection is created. Thehistorical_data_enabled quick setting decides whether the connection also delivers data that was already in the dataset when you created it:
- With
historical_data_enabledset totrue, the connection first delivers data already in the dataset, then keeps delivering new snapshots as they land. - With
historical_data_enabledset tofalse, the connection delivers only snapshots written after it was created.
historical_data_enabled delivers everything in the dataset when the connection is created. After that, each new snapshot is delivered as it lands.
An audience connection adds members and never removes them. When you overwrite the dataset, the connection adds the rows in the new snapshot, and members missing from it stay in the audience.
A conversion connection sends each event in each snapshot it delivers. Uploading the same events again in a new snapshot sends them again.
Delivery notifications
The TikTok Connector reports each delivery as an app webhook event. Subscribe a webhook to app19 to receive them:
secret to verify each delivery. The connector sends these events:
Read a subscription with
GET /webhooks/{webhook_id}. 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
TikTok Connector
Supported identifiers and connector setup
TikTok Conversions API Connector
Conversion event fields, event names, and identifier matching
Webhook Event Reference
Subscription fields, delivery payloads, and verification
API Keys
Create and rotate keys for programmatic access

