User Data

User data represents an individual visitor's profile and identity. You use the user object to track profile information for a visitor, whether they are anonymous or known (logged-in).

The primary goal of sending user data is to identify the visitor across sessions and devices and to enrich their profile with descriptive information.

The user object is included within the event payload sent to the Salesforce Interactions SDK. It contains fields for anonymous tracking, known identity matching, and profile attributes.

FieldTypeDescription
anonymousIdstringThe SDK-managed identifier for the user's browser/device. Automatically attached to every event by the SDK.
user.attributesobjectUser-supplied values that contain descriptive data used to enrich the user's profile (for example, firstName, lastName, city)
user.identitiesobjectCritical for identification. Contains one or more key-value pairs used to link the anonymous user to a known customer profile (for example, loyaltyId, email, CRMId).

This structure shows the full user object, including the SDK-managed anonymousId, and user-supplied identities and attributes:

You only need to send the user object when the visitor's identity or attributes are first discovered or updated (such as, after login, during registration, or upon form submission).

This example captures the user's identity and attributes immediately upon login or when their details are known, without an associated interaction. The SDK uses the identities to match the current anonymous session to a known profile.

Here’s how a user profile data is captured using the Web SDK with an interaction.

Use the SDK's global.onActionEvent handler to consistently inject user information across all events.

This example shows how to automatically attach a known email address (if available in a global variable like window.user_info) as a user attribute to every event.

See Also