Prompt
How do I build an attribution model when cookies are missing and users switch devices?
Latest observation
When cookies are missing and users switch devices, you need to move from cookie-based attribution to a people-based or identity-resolved attribution model. The core idea is: stitch events together using stable identifiers and probabilistic signals, then attribute conversions across all observed touchpoints.
1) Start with the identity strategy
You need a way to connect events across devices and sessions.
Best-case identifiers
Use deterministic IDs when available:
- User ID from login
- Email hash
- CRM/customer ID
- Loyalty ID
- Order/account ID
Supporting identifiers
When deterministic ID is unavailable:
- First-party cookie or local storage ID
- Auth/session ID
- Device fingerprinting signals
- IP + user-agent + time window
- Mobile advertising IDs, if permitted
Priority order: deterministic > first-party persistent > probabilistic.
2) Build an identity graph
Create a system that maps many event IDs to one person/entity.
Example:
- Device A + browser cookie + email login → Person 123
- Device B + app login + same email → Person 123
Store:
person_iddevice_idsession_idcookie_idemail_hash- timestamps
- confidence score
- source of match
This lets you unify touchpoints before attribution.
3) Capture all touchpoints with rich metadata
For every interaction, log:
- timestamp
- channel/source/medium/campaign
- device type
- browser/app
- logged-in state
- landing page
- referrer
- geo
- event type
- conversion value
If possible, use server-side event collection in addition to client-side tracking to reduce loss from ad blockers and browser restrictions.
4) Choose an attribution approach
There are three common classes:
A. Rule-based attribution
Simple and easy to explain:
- First touch
- Last touch
- Linear
- Time decay
- Position-based
Useful for reporting, but weaker when journeys span devices and missing data.
B. Algorithmic attribution
Use data-driven models:
- Markov chains
- Shapley value attribution
- Survival models
- Logistic regression / gradient boosting
- Causal incrementality models
These can handle multi-touch paths better and are more robust when journeys are incomplete.
C. Hybrid approach
Often best in practice:
- Deterministic identity stitching
- Probabilistic matching for gaps
- Data-driven attribution on stitched journeys
- Incrementality testing to validate the model
5) Handle missing cookies and cross-device gaps
Since cookies won’t always exist, model the missingness explicitly.
Practical methods
- Use first-party server-side IDs whenever possible
- Encourage login or email capture early
- Use event stitching across devices with deterministic login events
- For anonymous users, use session-level attribution until identity is resolved
- Merge anonymous pre-login activity into the known user’s profile once they authenticate
Example
A user clicks an ad on mobile, browses anonymously, later logs in on desktop and purchases.
- Mobile ad click is stored under anonymous session
- Desktop login reveals person ID
- Merge mobile session into person timeline
- Attribute part or all of conversion credit back to the mobile ad depending on your model
6) Use probabilistic matching carefully
When deterministic IDs are missing, you can infer likely matches using:
- IP overlap
- browser/device characteristics
- timing patterns
- location consistency
- behavior similarity
Assign a confidence score and only use high-confidence matches for attribution. Keep probabilistic matches separate from deterministic ones in reporting.
7) Build attribution on user journeys, not cookies
Your unit of analysis should be:
- person journey when identity is known
- session journey when identity is unknown
For each conversion:
- Collect all prior touchpoints within an attribution window
- Resolve identities
- Assign credit based on chosen model
- Roll up by campaign/channel/source
8) Validate with incrementality tests
Attribution models can be biased, especially with missing data. Validate with:
- geo holdouts
- audience holdouts
- PSA/control experiments
- lift tests
- conversion delay analysis
Incrementality tells you whether a channel truly caused conversions, not just appeared near them.
9) Account for privacy and compliance
Make sure your approach complies with:
- GDPR
- CCPA/CPRA
- ePrivacy/consent rules
- platform policies
Use consent management, data minimization, hashing where appropriate, and transparent disclosures.
10) A practical architecture
A typical stack looks like this:
- Collection
- Web/app/server-side tracking
- Identity resolution
- Deterministic matching
- Probabilistic matching
- Event warehouse
- Unified user timeline
- Attribution engine
- Rule-based or data-driven model
- Reporting layer
- Channel, campaign, cohort, ROI
- Experimentation
- Incrementality validation
11) Recommended starting point
If you’re just starting:
- Implement first-party event collection
- Add login/email-based identity stitching
- Use last-touch + first-touch as a baseline
- Move to Markov or data-driven attribution
- Validate with lift tests
12) Important caveat
If you can’t reliably identify users across devices, you cannot get perfect user-level attribution. In that case, you should complement person-level modeling with:
- aggregated MMM (marketing mix modeling)
- incrementality experiments
- channel-level reporting
That combination is often more reliable than trying to force a fully deterministic user path that doesn’t exist.
If you want, I can also give you:
- a step-by-step implementation plan
- a sample data schema
- or a Python/Pandas example for cross-device attribution.