This page covers technical implementation — the identity fields on events, how session stitching works, and the impact on destination match quality. For a conceptual overview of identity resolution and how the identity graph works, see Identity Resolution.
Identity Fields on Events
After identity resolution, events carry these identity-related fields:| Field | Location | Description |
|---|---|---|
session_id | Event root | Groups all events within a single browsing session. Set by the first-party cookie. |
identity_id | Event root | The resolved Upstack identity ID. Present once the visitor has been identified. |
em | user_data | SHA-256 hashed email address. |
ph | user_data | SHA-256 hashed phone number. |
external_id | user_data | Shopify customer ID or other external identifier. |
fbc | user_data | Meta click ID cookie linking the session to an ad click. |
fbp | user_data | Meta browser ID cookie for cross-session continuity. |
ttclid | user_data | TikTok click ID for ad attribution. |
gclid | user_data | Google click ID for ad attribution. |
client_ip_address | user_data | Visitor IP address. |
client_user_agent | user_data | Browser user agent string. |
How Identity Attaches to Events
Identity resolution happens at the Resolve stage of the pipeline, between event capture and destination forwarding.1. First-Party Cookie Matching
When a visitor lands on your store, the Upstack Pixel sets a first-party cookie. Every event in that browsing session shares the samesession_id. If the visitor has been seen before (returning visitor), the cookie links to their existing identity profile.
2. Deterministic Identification
When a visitor provides a hard identifier — logging in, entering an email at checkout, clicking a Klaviyo email link — Upstack ID creates a deterministic match:- The
session_idis linked to the customer’sidentity_id em(hashed email) andph(hashed phone) are attached to the eventexternal_idis set from the Shopify customer ID
3. Session Stitching
This is where the real value emerges. When identification happens mid-session (e.g., at checkout), Upstack ID retroactively enriches all prior anonymous events in that session with the resolved identity data. A typical session flow:| Event | Before Stitching | After Stitching |
|---|---|---|
| PageView (homepage) | IP + user agent only | IP + user agent + em + ph + identity_id |
| ViewContent (product page) | IP + user agent only | IP + user agent + em + ph + identity_id |
| AddToCart | IP + user agent only | IP + user agent + em + ph + identity_id |
| InitiateCheckout | IP + user agent + em + ph | IP + user agent + em + ph + identity_id |
| Purchase | IP + user agent + em + ph | IP + user agent + em + ph + identity_id |
Session stitching is retroactive within the session. Events are held briefly in the pipeline to allow late-arriving identity data to propagate. The hold window is short enough to maintain near-real-time forwarding.
4. Cross-Device Linking
When the same email or phone appears across sessions on different devices, Upstack ID merges those sessions under a singleidentity_id. A shopper who browses on mobile and purchases on desktop is recognized as one customer.
Cross-device linking enables:
- Accurate attribution across devices
- Larger retargeting audiences (one profile instead of two)
- Complete customer journey visibility in analytics
Impact on Destination Match Quality
Identity resolution directly drives the match keys available for each destination:| Destination | Key Match Fields | Typical EMQ Without Stitching | Typical EMQ With Stitching |
|---|---|---|---|
| Meta CAPI | em, ph, fbc, fbp, IP, user agent | 3–5 | 7–9 |
| TikTok Events API | em, ph, ttclid, IP, user agent | 2–4 | 6–8 |
| Klaviyo | em, ph | Partial profiles | Complete profiles |
| GA4 | client_id, user_id | Anonymous only | Identified users |
How This Connects to the Broader Pipeline
Identity resolution sits between event capture and destination forwarding:- Capture — Upstack Pixel fires raw events with whatever signals are available.
- Resolve — Upstack ID attaches identity, stitches sessions, and links devices. (You are here.)
- Enrich — Product catalog data and UTM parameters are merged.
- Activate — Identity-enriched events are forwarded to destinations with maximum match keys.
Related Documentation
Identity Resolution
Conceptual overview: identity graph, deterministic matching, cross-device linking.
JavaScript SDK
How to call identify() to associate user identity with sessions.
Properties & Context
Full reference for all identity fields, custom data, and context on events.
Standard Events
Events that carry identity data after resolution.