Identity Stitching After Login: Guide & Limits
Follow a worked example of anonymous and account identifiers, then test logout, shared devices, cross-device linking and coverage.
Lin browses products on a phone on Monday, registers on Tuesday and signs in on a computer to purchase on Wednesday. An analyst sees three identifiers: the phone's anonymous ID, the account ID and the computer's anonymous ID. Without reliable links, browsing before signup, signed-in activity and the second device's visit may appear as separate visitors.
Identity stitching connects records when evidence supports the connection. It is not a way to guess that two unfamiliar devices belong to the same person, and it cannot restore events that were never collected. The person and events below are a fictional example.
Follow the events before and after linking
| Time | Device | Visitor ID on event | Anonymous ID also supplied | Action |
|---|---|---|---|---|
| Monday | Phone | v_phone |
— | Viewed product |
| Tuesday | Phone | v_phone |
— | Started signup |
| Tuesday | Phone | u_lin |
v_phone |
Completed signup |
| Wednesday | Computer | v_pc |
— | Viewed home page |
| Wednesday | Computer | u_lin |
v_pc |
Signed in |
| Wednesday | Computer | u_lin |
v_pc |
Payment succeeded |
| Wednesday | Another device | v_other |
— | Viewed home page |
Assume v_other belongs to a different visitor and the table contains all events in the example. Deduplicating the visitor IDs as recorded yields v_phone, v_pc, u_lin and v_other: four identifiers. One identifier has a payment, so the identifier-level purchase proportion is 1 ÷ 4 = 25%.
If both anonymous-to-account relationships are real and valid, attributing the anonymous records for v_phone and v_pc to u_lin yields two distinguishable identities: Lin and v_other. One purchased, giving 1 ÷ 2 = 50%. The numbers illustrate different units and rules; they do not mean stitching increased the real business conversion rate by 25 percentage points.
The computer's pre-login v_pc has a basis for linking only because a later event supplies both v_pc and u_lin. If the computer never signs in and no other reliable relationship exists, similar devices or a shared network do not establish that the visits belong to one person.
Where a link comes from
After successful login or registration, the system needs the stable internal user ID and the current device's anonymous ID, and must send their relationship. Use an internal or appropriately processed user identifier, not an email address, phone number, name or payment detail.
With the ScreenFlows browser script, call after successful login:
screenflows.identify('u_example');
Subsequent browser events use the account ID and include the device's anonymous ID. A server event can also provide both user_id and anonymous_id; the connection documentation describes a $identify event when only a link is needed. When data is imported or merged, the system uses these relationships to process anonymous records. A phone and computer have a basis for connection when each is successfully linked to the same account ID.
In the current code, if an anonymous ID links to multiple accounts, the mapping selects the earliest account by event time. This makes conflict handling deterministic; it does not prove that every anonymous action on a shared device belongs to that person. Before using user-level results to make decisions, test whether that attribution fits the business, especially if shared devices are common.
Logout and shared devices: test instead of assuming
The ScreenFlows browser documentation provides screenflows.identify(null) to clear the current signed-in user, after which browser events return to the device's anonymous ID. That is not a promise that the device's anonymous ID is reset. The current merge implementation maps records whose visitor ID is a linked anonymous ID to the chosen account; it does not divide anonymous records into login and logout intervals. On a shared device that keeps the same anonymous ID, later anonymous activity may still be attributed to the earliest linked account.
For example, Lin signs in on a family tablet, signs out, another person browses, and then another account signs in. If both uses share the anonymous ID, the earliest-link rule cannot reliably distinguish the two people's anonymous browsing. Do not personalize outreach or assert ownership of that path for either person. Check whether the SDK and the business integration support the identity isolation required, and test it; if they cannot isolate the activity reliably, document the limit in analysis and coverage.
Clearing the current account and guaranteeing a new identity for the next visitor are different operations. If a business requires a new anonymous identifier on logout, do not assume identify(null) provides it. Confirm the supported integration first rather than changing browser storage in an unverified way.
Consent, missing data and history
A path can break when someone declines collection, withdraws consent, enables browser privacy controls or clears local storage. Do not bypass that choice through guessing or alternate identifiers. Even if someone signs in later, only records actually received and reliably matchable can be linked; uncollected events cannot be recovered.
Whether history can be linked depends on accurate anonymous-to-account mappings, timing, permission and the import system's behavior. Without a reliable mapping, do not force a merge because IP addresses match, email strings look similar or visits occurred close together. Before reprocessing history, establish authorization, backups, expected definitions and consequences; an incorrect merge can join records belonging to different people.
Stitching can introduce selection bias. People who can be linked may sign in more often, while consistently anonymous visitors are absent from cross-device user reports. When reporting a seven-day purchase proportion, state who was linkable, the starting event and the observation window. With incomplete identity coverage, a session view is still useful for a single visit, but it answers a different question.
When a business uses several data sources, verify that each supplies the same actual identifiers. The browser anonymous ID, the value received by the server and the anonymous column in an uploaded file must refer to the same linkable visit. Calling every field anonymous_id does not create a relationship. Include time zones in timestamps: incorrect times can change which shared-device account is considered earliest.
For example, have a test account sign in and out on a phone, then sign into a second account. Record each test event’s account ID, anonymous ID and timestamp before checking the imported attribution; an aggregate user count is not enough. If the anonymous ID was shared and activity is misattributed, stop using that result for user-level profiles while investigating the integration and product rule. Hiding an anomalous count is not a repair.
How to validate an integration
- One device before and after login: in an environment where collection is allowed, browse anonymously, sign in and trigger an event. Confirm both records and expected linking keys exist. Use test data, not real customer details.
- A second device: browse anonymously in another browser, then sign into the same test account. Check whether the anonymous records from both devices are attributed as expected. Do not claim a third device that never signs in has been linked.
- Logout and shared devices: clear the current account, generate another anonymous event and inspect the merged attribution. Sign into a second test account and record conflict handling. Check whether the result meets the business requirement.
- Reconciliation: inspect duplicate links, event ordering, missing events and user counts after import. A changed count alone does not prove that stitching works; inspect the test records.
- Consent and collection pause: test behavior when consent is declined or withdrawn. Test data must not contain emails, phone numbers, tokens or other sensitive content.
Do not require the signup conversion rate to rise noticeably after stitching. Most people may already have been identified, traffic mix may have changed, or the metric definition may differ. Verifying specific test paths and relationships is stronger than expecting a particular movement in an aggregate rate.
What ScreenFlows can and cannot do
The browser script supports identify, and server events can include the anonymous and account IDs. The identity section of connection checks helps inspect recent reporting, but should be combined with test accounts, events and imported results. Data connection, event naming and privacy settings still need to match the business flow; see the event naming guide.
Stitching makes known paths more complete. It does not infer an identity across unrelated devices or prove that a step caused a purchase. When comparing reports before and after linking, preserve dates, definitions, coverage and rule changes so a data-processing change is not mistaken for business improvement.
References
- MDN Web Docs: Web Storage API and browser storage partitioning limits
- MDN Web Docs: Navigator.sendBeacon() and reliable page-unload telemetry
FAQ
If someone signs in on a phone, does an anonymous computer visit link automatically?
Not without a reliable relationship. If the computer later signs into the same account and the link is reported correctly, its anonymous records can be processed using that relationship. Leave unrelated visits unknown rather than guessing.
Does hashing an account ID eliminate privacy risk?
No. A stable identifier may still be associated with a person. Collection, access, retention and use need to follow applicable requirements and user choices. Prefer an internal ID that does not contain contact details.
Why can user counts and conversion rates change after linking?
Several identifiers for one person may merge, changing denominators and path attribution. Reconcile the test events, linking rules and observation window first. A change in the report does not itself mean real user behavior changed.