Account Data
Account data represent user information at the account level. The account fields allow
you to capture data for many customers in one account.
1{
2 account: {
3 id: '43296241300',
4 attributes: {
5 role: 'Subscriber'
6 }
7 }
8}User object fields:
| Field Name | Field Type | Description |
|---|---|---|
| account.attributes | object | A user-supplied value. |
| account.id | string | Required. An account identifier for the user. |
Example
Here’s how account data is captured using the Web SDK without Interaction.
1SalesforceInteractions.sendEvent({
2 account: {
3 id: '43296241300',
4 attributes: {
5 role: 'Subscriber'
6 }
7 }
8})Here’s how account data is captured using the Web SDK with Interaction.
1SalesforceInteractions.sendEvent({
2 interaction: {
3 name: 'View Catalog Object',
4 catalogObject: {
5 type: 'Product',
6 id: 'product-xyz',
7 attributes: {
8 name: 'Product XYZ',
9 category: 'Clothing',
10 color: 'Red'
11 }
12 }
13 },
14 account: {
15 id: '43296241300',
16 attributes: {
17 role: 'Subscriber'
18 }
19 }
20})Here’s how account data is captured using the Sitemap.
1SalesforceInteractions.init().then(() => {
2 const sitemapConfig = {
3 global: {
4 onActionEvent: (event) => {
5 const accountId = window.accountId;
6 if (accountId) {
7 event.account = event.user || {};
8 event.account.id = accountId;
9 }
10 return event;
11 },
12 },
13 pageTypes: [{
14 name: 'product_detail',
15 isMatch: () => true,
16 interaction: {
17 name: SalesforceInteractions.InteractionName.ViewCatalogObject,
18 catalogObject: {
19 type: 'Product',
20 id: 'product-xyz',
21 attributes: {
22 name: 'Product XYZ',
23 category: 'Clothing',
24 color: 'Red'
25 }
26 }
27 }
28 }]
29 }
30 SalesforceInteractions.initSitemap(sitemapConfig)
31})