Overview
Web browsers enforce same-origin policies that restrict cookies set by one domain (e.g.,example.com) to be readable only within that same domain. This means different companies typically maintain separate, isolated cookie-based identifiers for the same user.
Cookie syncing bridges these separate namespaces by passing identifiers as query parameters, creating a shared understanding between Narrative and partner systems.
Partner-initiated syncs
Narrative currently supports partners initiating the sync. Partners call the Narrative endpoint with their identifier, and Narrative can optionally redirect back with the Narrative identifier.Endpoint
Query 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. |
red | No | URL-encoded redirect URL. If provided, Narrative redirects back to this URL with the Narrative ID appended. |
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 implementation
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
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.

