User identity across tools
Understand how Screeb matches the events of Segment, RudderStack or Amplitude to respondents, and keep one profile per person in both tools.
When Segment, RudderStack or Amplitude sends events to Screeb, each event must land on the right respondent. This works when both tools know the person by the same ids. Read this before you connect one of these sources on a site where the Screeb SDK already runs.
The ids of each tool
Section titled “The ids of each tool”Each event carries a user id once the visitor is logged in, and an anonymous id before.
| Tool | User id | Anonymous id | Read the anonymous id with |
|---|---|---|---|
| Segment | userId |
anonymousId |
analytics.user().anonymousId() |
| RudderStack | userId |
anonymousId |
rudderanalytics.getAnonymousId() |
| Amplitude | user_id |
device_id |
amplitude.getDeviceId() |
How Screeb matches events
Section titled “How Screeb matches events”Screeb finds the respondent of each event from its user id, or from its anonymous id when the visitor is not logged in. When an event carries both, Screeb links them to one respondent, so a visitor who logs in keeps a single profile. Screeb never moves an id from one respondent to another: an anonymous id that already belongs to another respondent stays there.
- A respondent holds at most 20 ids. Past that, a new anonymous id is no longer linked to it: the event still goes to the respondent of its user id, but a later event carrying only that anonymous id creates a new anonymous respondent.
- Never send one user id for several people (a placeholder for logged-out visitors, a shared test account): all their events would land on one respondent. Send those events without a user id.
Align the ids with the Screeb SDK
Section titled “Align the ids with the Screeb SDK”Screeb does not read the ids of the other tool from your page: aligning them is part of your instrumentation.
- Identify users in Screeb with the exact string you give the other tool when the user logs in:
$screeb('identity', userId); - Give Screeb the anonymous id of the other tool, so events sent before login reach the same respondent:
$screeb('identity.anonymous_id', anonymousId);, with the call of the table above. The id must be 5 to 128 characters. - On logout, reset Screeb and the other tool together, then give Screeb the new anonymous id.
The identity guide of the SDK has the details, the mobile SDK calls and the Google Tag Manager setup.
Limits
Section titled “Limits”Events sent before login count only when both anonymous settings are off: Would you like to ignore events from anonymous users? on the source page, and the workspace setting Ignore anonymous users. An event with a user id is never dropped.