Overview
The data collection endpoint supports two primary use cases:- Cookie syncing: Share browser-based identifiers between domains to create a shared understanding of user identity across separate cookie namespaces.
- Custom data collection: Send arbitrary key-value pairs alongside identifiers, which are ingested into a Narrative dataset for downstream use.
Endpoint
Query parameters
Required parameters
| Parameter | Required | Description |
|---|---|---|
companyId | Yes | Unique ID assigned to the partner by Narrative |
id | Yes | Type and value of the identifier, formatted as partner_id_type:partner_id_value. The partner_id_type is assigned to partners by Narrative. |
Optional parameters
| Parameter | Required | Description |
|---|---|---|
red | No | URL-encoded redirect URL. If provided, Narrative redirects back to this URL with the Narrative ID appended. |
Custom parameters
Any additional query parameters beyondcompanyId, id, and red are ingested as custom key-value pairs into the partner’s Narrative dataset. This allows partners to enrich each request with arbitrary metadata without requiring changes to the endpoint schema.
Custom parameter values are ingested as strings. Use descriptive, consistent key names across requests.
Macros
When using the redirect parameter, you can include macros that Narrative replaces with actual values:| Macro | Description |
|---|---|
${narrative.id.value} | Replaced with the Narrative cookie identifier on redirect |
Examples
Basic cookie sync
A partner called BrandA wants to sync their customer identifier with Narrative. Given:- Company ID:
789 - Customer ID:
123456789 - Partner ID type (assigned by Narrative):
brandA_id
Cookie sync with redirect
To receive the Narrative identifier back, include a URL-encoded redirect URL with the macro:${narrative.id.value} with the actual Narrative cookie identifier before redirecting.
Custom data collection
Partners can include additional query parameters to send custom data alongside the identifier. These key-value pairs are ingested into the partner’s Narrative dataset. Given:- Company ID:
789 - Customer ID:
123456789 - Partner ID type:
brandA_id - Custom data: page category, campaign ID
page_category and campaign_id are ingested as custom attributes in the partner’s dataset alongside the standard identifier data.

