Account Data
Account data is used to capture information about a customer's business, organizational affiliation, or group rather than the individual user themselves. This is crucial when a single account (for example, a company, household, or organization) can have multiple users (individuals) associated with it. By attaching an accountId, you can group interactions and behaviors across all related users for holistic account-level analysis.
The account object includes these fields.
| Field | Type | Description |
|---|---|---|
account.id | string | Required. The unique identifier for the account. |
account.attributes | object | An object for any custom data you want to associate with the account, such as an industry, subscription tier, or company size. |
This JSON structure illustrates a typical account payload, including its unique identifier and custom attributes.
Account data is typically sent with every interaction to ensure all interactions are properly attributed to the correct account.
Here's how to capture and send account data for a simple, non-interaction event, such as a page view where no specific catalog object is involved.
This example demonstrates including account data alongside a specific user interaction with a product, ensuring both the individual user's behavior and their organizational context are captured.
The Sitemap is the recommended way to automatically and consistently inject the account.id into every event fired or interaction occurring across your site. This is done using the onActionEvent global handler.
This example assumes the accountId is already available on the page, such as being stored in a global JavaScript variable like window.accountId.
See Also