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.

{
    account: {
        id: '43296241300',
        attributes: {
            role: 'Subscriber'
        }
    }
}

User object fields:

Field NameField TypeDescription
account.attributesobjectA user-supplied value.
account.idstringRequired. An account identifier for the user.

Account Data Without Interaction Example 

Here’s how account data is captured using the Web SDK without Interaction.

SalesforceInteractions.sendEvent({
    account: {
        id: '43296241300',
        attributes: {
            role: 'Subscriber'
        }
    }
})

Account Data with Interaction Example 

Here’s how account data is captured using the Web SDK with Interaction.

SalesforceInteractions.sendEvent({
   interaction: {
        name: 'View Catalog Object',
        catalogObject: {
            type: 'Product',
            id: 'product-xyz',
            attributes: {
                name: 'Product XYZ',
                category: 'Clothing',
                color: 'Red'
            }
        }
    },
    account: {
        id: '43296241300',
        attributes: {
            role: 'Subscriber'
        }
    }
})

Sitemap Account Data Example 

Here’s how account data is captured using the Sitemap.

SalesforceInteractions.init().then(() => {
   const sitemapConfig = {
        global: {
            onActionEvent: (event) => {
                const accountId = window.accountId;
                if (accountId) {
                    event.account = event.user || {};
                    event.account.id = accountId;
                }
                return event;
            },
        },
        pageTypes: [{
            name: 'product_detail',
            isMatch: () => true,
            interaction: {
            name: SalesforceInteractions.InteractionName.ViewCatalogObject,
                catalogObject: {
                    type: 'Product',
                    id: 'product-xyz',
                    attributes: {
                        name: 'Product XYZ',
                        category: 'Clothing',
                        color: 'Red'
                    }
                }
            }
        }]
    }
    SalesforceInteractions.initSitemap(sitemapConfig)
})

See Also