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.
| Field | Provided By | Type | Description |
|---|---|---|---|
account | Developer | Account | Captures profile event data for an account. |
consents | SDK | Consents | Contains a list of consent values attached to the first event captured after a customer consents to tracking or when a customer revokes consent. |
interaction | Developer | Interaction | Captures customer engagement event data. |
pageView | SDK | Page View | Indicates if the event was captured during a page load. |
source | SDK | Source | Contains event metadata about the page, including URL, referrer, channel, and locale information. |
time | SDK | Time | Shows the timestamp of the event in milliseconds elapsed since the UNIX epoch. |
user | Developer | User | Captures 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.
interactionThis field captures the customer's engagement event data. At a minimum, an interaction requires a valid
namevalue. The SDK supports several specialized interaction types that map to Data Cloud's unified data model:userThis 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.
accountThis 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.
sourceThis field provides the context of the event, including the page
url, thechannel(alwaysWebwhen using the Interactions SDK), and the currentlocale.timeThe precise server timestamp of the event capture.
pageViewA flag indicating if the event was part of the initial page load process.
consentsAn 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