Skip to main content

For AI agents: a Markdown version of this page is at https://docs.snowplow.io/docs/signals/data-sources/existing-analytics/how-it-works/identifiers.md. The index of all documentation pages is at https://docs.snowplow.io/llms.txt, and the index for this section is at https://docs.snowplow.io/docs/signals/llms.txt.

Identifiers and attribute keys for events from your existing tool

Signals calculates and serves attributes per attribute key, such as domain_userid for a visitor or domain_sessionid for a session. Client-side approaches fill these with Snowplow's own random IDs. Server-side approaches fill them with your tool's IDs. Either way, your tool's IDs are also kept in the external_identity entity, so you can join back to your tool's data.

Which IDs become domain_userid and domain_sessionid​

ToolClient-side approachServer-side approachWarehouse history
SegmentSnowplow's random IDanonymousIdanonymousId
RudderStackSnowplow's random IDanonymousIdanonymous_id
GA4 and GTMSnowplow's random IDGA client IDuser_pseudo_id, the GA client ID
AmplitudeSnowplow's random IDdevice_iddevice_id
AdobeSnowplow's random IDECIDmcvisid, the ECID
PostHogSnowplow's random ID$device_id$device_id, or distinct_id

Amplitude's variant without the Snowplow tracker keys on device_id, like the server-side approaches. Server libraries accept any string as an anonymous ID, so check what your server sources send.

Sessions​

On client-side approaches, sessions use Snowplow's domain_sessionid. Server-side approaches have no Snowplow sessions, except on two tools whose events carry a session ID:

  • PostHog: $session_id becomes domain_sessionid unchanged.
  • Amplitude: the adapter builds a session key from device_id and Amplitude's session ID. Your page can build the same key from amplitude.getDeviceId() and amplitude.getSessionId() to read session attributes.
How the Amplitude session key is built
js
function sessionKey(deviceId, sessionId) {
if (!deviceId || sessionId === undefined || sessionId === null || sessionId < 0) return undefined;
var d = String(deviceId).toLowerCase();
var tail = ('000000000000' + Number(sessionId).toString(16)).slice(-12);
if (/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(d)) return d.slice(0, 24) + tail;
// device_id isn't a UUID: derive a stable UUIDv5 from both values instead.
return uuidv5('amplitude-session:' + deviceId + ':' + sessionId, NAMESPACE);
}

Other tools' session IDs, where they have one, are kept in external_identity.session_id for joins only.

Tool IDs by tool​

Each tool's IDs, where they land in Snowplow, and whether you can use them as a Signals attribute key.

Segment fieldSnowplow fieldUse as a Signals key?
Snowplow cookie ID (client-side)domain_useridYes. Random, and safe on the public intervention endpoint
Snowplow session ID (client-side)domain_sessionidYes, for session attributes
anonymousIdServer-side: domain_userid. Both: external_identity.anonymous_idServer-side key, for reads from your backend only. Never on the public intervention endpoint
userIduser_id, external_identity.user_id, and identify.id, unchanged. If it's an email address, the email reaches SnowplowBackend reads only. Never on the public intervention endpoint
groupIdexternal_event.group_idBackend reads only, for account attributes
messageIdevent_id (server-side)No

Keys you can use on the public intervention endpoint​

Your application subscribes to interventions through a public endpoint, by attribute key value. Anyone who knows or can guess a value could subscribe to it, so use a random value nobody can enumerate.

KeySafe on the public endpoint?
Snowplow domain_userid and domain_sessionid on client-side approachesYes
Segment and RudderStack anonymousId, PostHog $device_id and $session_idNot recommended: they can be predicted in part, or set to any value by server SDKs
Amplitude device_id, Adobe ECID, GA client ID, GA and RudderStack session IDsNo: they can be set from a link, aren't documented as random, or contain timestamps
user_id, group_idNo: chosen by you and often guessable

The recommended pattern:

  • Interventions: a client-side approach, keyed on domain_userid or domain_sessionid.
  • Logged-in reads from your backend: read by user_id through the Profiles API, which isn't public.
  • Server-side approaches: read attributes from your backend by your tool's ID.

Join back to your tool with external_identity​

Every event carries an external_identity entity with the IDs your tool assigned and the original event name:

json
{
"schema": "iglu:com.example/external_identity/jsonschema/1-0-0",
"data": {
"tool": "amplitude",
"anonymous_id": "56faf157-e1d8-4e4c-9e1f-3886820b6190",
"user_id": "user-123",
"session_id": "1794586019823",
"event_name": "$identify"
}
}
FieldHolds
anonymous_idYour tool's visitor ID: anonymousId, the GA client ID, device_id, the ECID, or $device_id
user_idYour tool's user ID
session_idYour tool's session ID, where it has one
session_numberGA4's session number, on GA4 only
event_nameThe event's name in your tool

Use it to join Snowplow events to your tool's own export, to compare counts by event name while you check the setup, and to keep history keyed on your tool's ID when you move to native tracking. Until your tool has set its ID, the entity is sent with a null anonymous_id.

The schema is under your own vendor, shown here as com.example. See Where to start.

Combine keys and keep history​

Each attribute key gives you a separate set of attributes. You can add a key on your tool's own ID, combine keys for the same person with identity resolution, and keep history when you move to native tracking.

Calculate attributes on your tool's ID​

To calculate attributes per ID your tool assigned, define a custom attribute key on anonymous_id. Read these attributes from your backend only.

python
from snowplow_signals import AttributeKey, EntityProperty

tool_visitor = AttributeKey(
name="tool_anonymous_id",
description="The visitor ID your analytics tool assigned",
property=EntityProperty(
vendor="com.example",
name="external_identity",
major_version=1,
path="anonymous_id",
),
)

Resolve identities with snowplow_id​

One attribute read uses one key, so attributes keyed on domain_userid and on user_id stay separate. To combine a person's anonymous and logged-in activity, use identity resolution, which needs Snowplow Identities on the same pipeline.

Key stream attribute groups on snowplow_id and select up to three lookup identifiers, such as domain_userid and user_id. Your website then reads by domain_userid and your backend by user_id, and both get the same person's attributes. Interventions are still delivered to domain_userid, so the public endpoint keeps a random key. This works for stream attribute groups only, from events processed after you publish.

When you move to native tracking​

On client-side approaches, domain_userid is already Snowplow's own ID, so attributes carry over when you replace the adapter with native tracking. On server-side approaches, history keyed on your tool's ID needs a custom key on external_identity.anonymous_id. See Move to native Snowplow tracking.

Was this page helpful?