The online Trailblazer Community is now read-only. [Read the FAQ] [Get Help]
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 name value. The SDK supports several specialized interaction types that map to Data 360'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.
source
url, the channel (always Web when using the Interactions SDK), and the current locale.time
Note: The
dateTimevalue is derived from the user’s browser/client clock (generated in UTC ISO-8601 format using JavaScriptDate(...).toISOString()). If the user’s device time is incorrect or unsynced, this value can be skewed significantly (past/future).
pageView
consents
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.
1SalesforceInteractions.sendEvent({
2 interaction: {
3 name: "View Catalog Object",
4 catalogObject: {
5 type: "Product",
6 id: "product-1",
7 },
8 },
9 user: {
10 attributes: {
11 email: "user@domain.com",
12 },
13 },
14});Here’s what the complete, captured event structure looks like, including all automatically-included fields.
1{
2 interaction: {
3 name: "View Catalog Object",
4 catalogObject: {
5 type: "Product",
6 id: "product-1"
7 }
8 },
9 source: {
10 pageType: "homepage",
11 url: "https://my.domain.com/home",
12 urlReferrer: "https://my.domain.com/search",
13 channel: "Web",
14 locale: "en_US"
15 },
16 user: {
17 anonymousId: "aa19dc4fcdc636d8", // Automatically assigned by the SDK
18 attributes: {
19 email: "user@domain.com"
20 }
21 },
22 consents: [{
23 purpose: 'Tracking',
24 provider: 'Example Provider',
25 status: 'Opt In',
26 }]
27 pageView: 0, // Automatically set by the SDK
28 time: 1628700769593 // Automatically set timestamp
29}See Also