Sub topic 11
Linking events and records into one customer profile
This chapter assumes you know what a CRM, a CDP and a warehouse are (covered in the previous chapter), and that you can read a simple SQL join. Identity resolution is the work of deciding that several events and records belong to the same person, then merging them into one customer profile.
Why records need linking
One customer leaves traces in many systems. A visitor browses anonymously on a phone, signs up for email on a laptop, and buys in a store with a loyalty card. Each system holds a different identifier:
- A cookie or device ID from web and app analytics
- An email address from the email platform
- A loyalty number or phone number from the point of sale
- A customer ID from the CRM
Without linking, you count one person as three. Your segments are wrong, your frequency caps fail, and your zero-party preferences never reach the channels that need them.
Deterministic and probabilistic matching
Deterministic matching joins records on an identifier that is exact and shared, such as a verified email or login ID. It is precise but only covers people who have identified themselves.
Probabilistic matching infers a link from signals such as device type, IP address and behavior. It reaches more people but produces wrong merges. For a program built on consent, prefer deterministic matching and treat probabilistic links as lower-trust.
| Approach | Strength | Main risk |
|---|---|---|
| Deterministic | High accuracy | Low coverage of anonymous traffic |
| Probabilistic | Wider coverage | False merges, harder to explain to customers |
How a profile is built
The usual pattern is an identity graph: a table that maps every known identifier to one profile ID.
The key event is usually a login, a form submission or a checkout. At that moment an anonymous ID meets a known identifier, and you can link them. Events recorded earlier under the anonymous ID can then be attached to the profile, but only if your consent rules allow it.
A small worked example
This query uses an identity map to attach web events to a customer profile.
SELECT m.profile_id,
e.event_name,
e.event_time
FROM web_events AS e
JOIN identity_map AS m
ON m.identifier_type = 'cookie_id'
AND m.identifier_value = e.cookie_id
WHERE e.event_time >= DATE '2026-11-01';The identity_map table has one row per identifier, and each row points to a profile_id. If one cookie maps to two profiles, this join duplicates events. That is why uniqueness checks on the map matter.
Common errors
- Shared devices. A family tablet links two people into one profile. Prefer login-based links over device-based links.
- Over-merging. A shared work email or a typo merges strangers. Set rules that block merges on generic addresses.
- Ignoring consent during merges. If a person granted consent under one identifier and refused it under another, the merged profile must keep the stricter state, not the more convenient one.
- No unmerge path. You need a way to split a profile when a merge was wrong.
Exercise
Exercise
A visitor browses anonymously, then logs in with an email. Their email consent is "granted", but their cookie ID was previously recorded with analytics consent "denied". What should the merged profile do with the earlier browsing events, and why?
Show answer
Keep the analytics denial. The merged profile must not use the earlier browsing events for analytics or personalization, because the customer refused that purpose. The email consent applies only to email marketing. Consent is stored per purpose, and when records merge, the stricter state wins for each purpose.