---
schema_version: "1"
id: 622fa79125555185ec3c946528ca415d79e49cffd5cecb256a48de6f2176ab97
title: Account Data
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/interactions-sdk/guides/c360a-api-account-data.md
canonical_url: https://developer.salesforce.com/docs/data/salesforce-interactions-sdk/guide/c360a-api-account-data.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9e2293a1763b9579abb7135bbcaf3f69b01e6a6480d88c6c584229c8b876f9d8
products:
  - Salesforce Interactions SDK
  - Data 360 Developer Documentation
---
# Account Data

Account data captures information about a customer's business, organizational affiliation, or group rather than the individual user. Account data matters when a single account (for example, a company, household, or organization) has multiple users associated with it. By attaching an `accountId`, you group interactions and behaviors across all related users for holistic account-level analysis.

## Account Data Structure

The `account` object includes this field.

| Field        | Type   | Description                                          |
| ------------ | ------ | ---------------------------------------------------- |
| `account.id` | string | **Required**. The unique identifier for the account. |

This JSON structure illustrates a typical `account` payload with its unique identifier.

```json
{
  "account": {
    "id": "43296241300" // Unique identifier for the organization/account
  }
}
```

## Examples of Sending Account Data

Send account data with an interaction to correctly attribute all interactions to the account.

This example includes account data alongside a specific user interaction with a product, so both the individual user's behavior and their organizational context are captured.

```javascript
SalesforceInteractions.sendEvent({
  // The specific action the user performed
  interaction: {
    name: "View Catalog Object",
    catalogObject: {
      type: "Product",
      id: "product-xyz",
      attributes: {
        name: "Product XYZ",
        category: "Clothing",
        color: "Red",
      },
    },
  },
  // The organizational context for the user performing the action
  account: {
    id: "43296241300",
  },
});
```

### Capture Account Data Using the Sitemap

To inject the `account.id` into all interaction events across your site consistently, use the Sitemap's `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`.

```javascript
SalesforceInteractions.init().then(() => {
  const sitemapConfig = {
    global: {
      // The onActionEvent function runs immediately before any event is sent.
      onActionEvent: (event) => {
        const accountId = window.accountId; // Get the ID from your site's variable

        if (accountId) {
          // Inject the account ID into the event object
          event.account = event.account || {};
          event.account.id = accountId;
        }
        return event; // Always return the modified event
      },
    },
    pageTypes: [
      // Example of a page type definition that fires an interaction
      {
        name: "product_detail",
        isMatch: () => true, // Example simple matching rule
        interaction: {
          name: SalesforceInteractions.InteractionName.ViewCatalogObject,
          catalogObject: {
            type: "Product",
            id: "product-xyz",
            attributes: {
              name: "Product XYZ",
              category: "Clothing",
              color: "Red",
            },
          },
        },
      },
    ],
  };
  SalesforceInteractions.initSitemap(sitemapConfig);
});
```

**See Also**

- [Translation of SDK Events to Web Connector Schemas](https://developer.salesforce.com/docs/data/salesforce-interactions-sdk/guide/c360a-api-translating-sdk-events-to-web-connector-schemas.md)
- [Custom Events](https://developer.salesforce.com/docs/data/salesforce-interactions-sdk/guide/c360a-api-custom-events.md)
