Event Structure

The Salesforce Interactions Web SDK captures every customer interaction and behavior through a standardized event structure. Each event combines system-generated properties and context (automatically set by the SDK) and developer-defined data (set by you) to build comprehensive customer profiles and track meaningful interactions.

Every event captured by the Salesforce Interactions Web SDK follows a consistent structure with these properties.

FieldProvided ByTypeDescription
accountDeveloperAccountCaptures profile event data for an account.
consentsSDKConsentsContains a list of consent values attached to the first event captured after a customer consents to tracking or when a customer revokes consent.
interactionDeveloperInteractionCaptures customer engagement event data.
pageViewSDKPage ViewIndicates if the event was captured during a page load.
sourceSDKSourceContains event metadata about the page, including URL, referrer, channel, and locale information.
timeSDKTimeShows the timestamp of the event in milliseconds elapsed since the UNIX epoch.
userDeveloperUserCaptures profile event data for a customer. Used to build comprehensive customer profiles.

The interaction, user, and account fields are your responsibility to populate when sending an event. These fields contain core data about the customer and their interactions.

interaction

This field captures the customer's engagement event data. At a minimum, an interaction requires a valid name value. The SDK supports several specialized interaction types that map to Data Cloud's unified data model:

user

This field captures the individual user's profile data (for example, email, loyalty ID, and first name). This data is crucial for user identification and profile enrichment.

account

This field captures profile data at the account level. Use this to group interactions across multiple individual users belonging to the same company or account.

Salesforce Interactions SDK automatically populates these fields for every event, providing necessary context and tracking identifiers.

source

This field provides the context of the event, including the page url, the channel (always Web when using the Interactions SDK), and the current locale.

time

The precise server timestamp of the event capture.

pageView

A flag indicating if the event was part of the initial page load process.

consents

An array containing the current consent status, which is included automatically when the status changes or on the first event after initialization.

This example shows how a call to SalesforceInteractions.sendEvent() is expanded by the Interactions SDK into the complete, verbose event object containing all system-generating tracking and contextual data.

This call captures behavioral (interaction) and profile (user) data from a site instrumented using the Interactions SDK.

Here’s what the complete, captured event structure looks like, including all automatically-included fields.

See Also