This document describes how to implement a server-side user identifier cookie (ywt_user_id) that ensures consistent tracking across multiple domains.

The cookie is used to restore user sessions and connect cross-domain events to a single customer profile in the CDP.


🎯 Objective


🌐 Example Domain Setup

Domain Description
example.com Main site
exampleapp.com App environment
examplemedia.com Campaign or content domain
examplepromo.com Landing page domain

All these domains share the same user identifier via the ywt_user_id cookie.


⚙️ Functional Logic

The cookie is set server-side, before any client-side scripts or GTM containers are loaded.

A client-side helper script then ensures the ID is passed between related domains.

1️⃣ ID Generation & Retrieval Logic

Step Action Result
1 Check if the current URL contains ?ywt_user_id= ✅ If present, use this value
2 If present → Set the ywt_user_id cookie with this value Persistent identification
3 If not in URL → Check if a cookie already exists ✅ Use existing value
4 If not → Generate a new unique identifier Create and store in cookie
5 Add ?ywt_user_id=<value> to all outbound links to other company domains Enables cross-domain continuity

🧱 Cookie Specification