Identity graph data model, graph resolution algorithm, deterministic vs probabilistic matching, confidence scoring, and a simplified look at the D1 schema behind it.
Customers move between devices constantly — browsing on a phone during the commute, researching on a work laptop, converting on a home desktop. Without cross-device identity resolution, each session looks like a different person — inflating unique visitor counts, breaking attribution, and fracturing behavioral profiles. This whitepaper details ClickStream's identity graph data model (nodes and edges), the graph resolution algorithm, the distinction between deterministic and probabilistic matching, the confidence weighting system, edge and signal types, a simplified conceptual model of the D1 database schema, and the complete identity resolution flow from anonymous visitor to unified customer profile.
When you view a visitor profile in the Visitors tab at einstein.clickstream.com, you see a unified timeline across all their devices — desktop, mobile, tablet — stitched together automatically once a deterministic anchor (a hashed email from a form, a login, a social sign-in, or a CRM ID) links the devices — supplemented by conservative probabilistic matching (device fingerprints, behavioral-profile similarity, household clustering) that only merges when independent signals corroborate. ClickStream deliberately refuses low-confidence merges other tools would make. This whitepaper explains the resolution algorithms that make it work.
The average customer journey spans multiple devices and sessions. Consider this scenario: a user sees a paid search ad on their phone, clicks through and browses for 2 minutes, leaves. Later that day, they search for the brand on their work laptop, read pricing documentation for 10 minutes, and sign up for a webinar using their work email. Two days later, they visit the site on their home desktop, log in, and complete a purchase.
Without identity resolution, analytics reports this as three separate visitors with three separate journeys. The paid search ad gets no attribution. The webinar signup is unconnected to the purchase. The behavioral profile is fragmented across three incomplete records.
Cross-device identity resolution is the process of connecting these fragmented signals into a single, unified customer profile. It is the prerequisite for accurate attribution, complete behavioral profiling, and reliable customer analytics.
ClickStream models identity as a directed graph where nodes represent identity signals and edges represent observed relationships between signals. This graph-based approach is more flexible than a flat table because it naturally handles many-to-many relationships (one person can have multiple devices, and one device can be shared by multiple people).
| Node Type | Identifier | Persistence | Uniqueness | Source |
|---|---|---|---|---|
| Cookie | First-party visitor ID | 400 days | Unique per browser+device | Server-set cookie via CNAME proxy |
| Email Hash | SHA-256 of normalized email | Permanent | Unique per person (ideally) | Form submission, login, checkout |
| Phone Hash | SHA-256 of normalized phone | Permanent | Unique per person | Form submission, account creation |
| Device Signature | Hash of device attributes | Session to days | Medium (shared across similar devices) | Screen, timezone, language, platform, GPU |
| IP Cluster | Hashed IP (raw IPs are never stored in the graph) | Dynamic | Low (shared across household/office) | Request headers |
| External ID | CRM ID, SSO ID, etc. | Permanent | Unique (from external system) | API integration, tag parameter |
Edges connect two nodes and carry a confidence score (0.0–1.0) representing the system's belief that the two nodes belong to the same person.
Each signal type carries a confidence weight in the shipped graph (hashed email 0.30, hashed phone / customer ID 0.20, social-login OAuth subjects 0.25, raw email/phone 0.15, mobile ad ID 0.10, device fingerprint 0.08, visitor ID 0.05). Probabilistic edges expire on TTLs from 7 to 90 days; deterministic signals never expire. Probabilistic cross-device merges require a combined confidence of at least 0.60 and a person-distinguishing signal.
Every resolved person also carries a confidence band — deterministic, probabilistic, or observed — so downstream consumers always know how an identity was established.
Deterministic matching creates high-confidence edges based on explicit identity signals. These edges are created when the visitor takes an action that directly reveals their identity:
login edge between the current cookie and the email hash.form_submit.checkout.Deterministic edges are the strongest signals in the identity graph. A single deterministic edge can resolve a previously anonymous visitor into a known customer and link all their historical behavioral data to that customer profile.
Probabilistic matching creates lower-confidence edges based on statistical signals that suggest two nodes may belong to the same person:
When two cookies are observed from the same hashed IP, they may belong to the same person using different browsers or devices. The shipped graph clusters households by hashed IP (raw IPs are never stored), excludes hosting, VPN, proxy, and Tor networks from clustering, and evaluates probabilistic cross-device candidates over a 30-day window. IP evidence alone is weighted low because addresses are shared across households and offices.
When two cookies share the same device signature (screen resolution, timezone, language, platform, GPU renderer), they may be the same device with cleared cookies. Device fingerprints carry a deliberately low signal weight (0.08) in the shipped graph because signatures are not perfectly unique — a fingerprint match alone never triggers a merge.
When two cookies exhibit similar behavioral patterns (same content affinity, similar navigation paths, similar engagement scores) from the same geographic region, they may be the same person. Behavioral-profile similarity is used only as supporting evidence for probabilistic matching — never as a merge trigger on its own.
Probabilistic confidence increases when multiple independent signals corroborate each other. The corroboration model below is illustrative — a simplification, not the shipped formula; in production, probabilistic merges are gated on a combined confidence of at least 0.60 plus a person-distinguishing signal:
The graph resolution algorithm merges nodes that are connected by edges exceeding a confidence threshold. The algorithm runs incrementally on every new edge creation:
When the algorithm detects that two previously separate identity clusters may belong to the same person (e.g., a visitor logs in on their phone and the email hash connects their phone cookie to their desktop cookie), it evaluates a cluster merge. Merges are never unconditional: the shipped system blocks merges on conflicting deterministic identifiers, never auto-merges an email seen on more than 5 visitors (the shared-mailbox cap), requires corroboration for mobile-ad-ID links, and records every merge in an auditable merge history — ClickStream deliberately refuses merges other tools would make. A merge that passes those guardrails executes conceptually like this:
The identity graph is stored in Cloudflare D1, a SQLite database at the edge. The production schema (22 migrations) centers on identity nodes with on-row deterministic identifiers, weighted edges, append-only person signals, materialized person profiles, a merge history log, and per-person confidence bands. A simplified conceptual model:
The identity resolution flow ingests signals from every incoming event at the edge; graph processing runs asynchronously through a queue consumer:
last_seen and proceed to edge evaluation.One guardrail worth noting: bot-classified visitors are quarantined out of the identity graph entirely — bots never become people.
Some customers operate multiple domains (e.g., marketing-site.com and app.product.com). ClickStream supports cross-site identity resolution while maintaining data isolation:
When a visitor logs in on one domain and the same email hash appears on another domain (both belonging to the same customer), the identity graph creates a cross-site edge. This requires both domains to be configured under the same ClickStream account.
Relative strength of cross-site signals (illustrative — not shipped confidence values):
| Signal | Cross-Site Confidence | Notes |
|---|---|---|
| Same email hash | 0.99 | Strongest cross-site signal |
| Same phone hash | 0.95 | Strong cross-site signal |
| Same external ID | 0.95 | CRM or SSO integration |
| Same device signature + IP | 0.50 | Moderate (could be shared device) |
| Same IP only | 0.15 | Very weak (office networks) |
Cross-device identity resolution transforms fragmented analytics into unified customer intelligence. ClickStream's graph-based identity model — with typed nodes, weighted edges, confidence scoring, and incremental resolution — handles the complexity of real-world customer journeys where one person uses multiple devices, clears cookies, switches browsers, and interacts across multiple company domains.
The key architectural decisions that make this work are: first-party cookies as the primary anchor (high persistence, high confidence), deterministic matching via email hash as the cross-device bridge, probabilistic matching as a supplementary signal with conservative confidence thresholds, and incremental graph resolution that executes on every event without batch processing.
The D1 schema is designed for edge-first execution: simple, denormalized where needed for performance, and partitioned by site for data isolation. The identity graph is not a data warehouse feature that runs nightly. It is a continuously updating system that ingests identity signals from every page view, form submission, and login event at the edge — no nightly batch required.
Stop paying to acquire the same person twice. Cross-device identity resolution unifies every visit into one conversion path — so your ad spend works harder.
Start free