---
schema_version: "1"
id: 6a0bb105e5ce5002cd28ea84369f23f175d5d5142f15c7d2791fb3a0949aa415
title: "Einstein Activity Tracking: Required Fields"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/cc/264-0-0/b2c_einstein_activity_required_fields.md
canonical_url: https://help.salesforce.com/s/articleView?id=cc.b2c_einstein_activity_required_fields.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: f2c9a9dc15682d940fbd48809d4912b1bf1bea1c9db89122fd1634b973edaa3a
description: When implementing Einstein activity tracking for hybrid or custom B2C Commerce storefronts, include specific fields for each activity type. This topic lists the required fields that Einstein APIs expect for proper data collection and attribution.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# Einstein Activity Tracking: Required Fields

When implementing Einstein activity tracking for hybrid or custom B2C Commerce storefronts, include specific fields for each activity type. This topic lists the required fields that Einstein APIs expect for proper data collection and attribution.

If you're that use Storefront Reference Architecture (SFRA) or SiteGenesis, the storefront tracks the required activity fields via `isobject` tags. However, if you're building a hybrid or custom storefront, be sure to track the required fields. Tracking the required fields enables Einstein to process the data.

Missing or incorrectly formatted fields can cause Einstien to incorrectly filter out imporant activities, resulting in incomplete data in Einstein dashboards and recommendations.

## Fields Required for All Activities

Every Einstein activity requires these base fields:

  
| Field | Type | Description |
| --- | --- | --- |
| `cookieId` | String | The unique identifier for the shopper session. This value links activities to a specific shopper. |
| `realm` | String | Your B2C Commerce realm identifier. |
| `siteId` | String | The site ID where the activity occurred. |
| `instanceType` | String | The instance type (`prd` for production instances). Einstein doesn't generate reports for non-production instances. |
| `activityType` | String | The type of activity. Valid values: `viewProduct`, `viewReco`, `clickReco`, `addToCart`, `finishCheckout`, `viewCategory`, `viewSearch`, `clickCategory`, `clickSearch`. |

## More Fields by Activity Type

In addition to the base fields, each activity type requires these specific fields:

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:22.22222222222222%">
          <col style="width:33.33333333333333%">
          <col style="width:44.44444444444444%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d236845e196">Activity Type</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d236845e199">Required Fields</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d236845e202">Notes</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Activity Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e196 "><code>viewProduct</code></td>

            <td data-label="Required Fields" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e199 ">
              <ul>
                <li><code>product.id</code></li>

              </ul>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e202 ">Fires when a shopper views a product detail page. Enables recently viewed
              recommenders and real-time personalization.</td>

          </tr>
          <tr class="">
            <td data-label="Activity Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e196 "><code>viewReco</code></td>

            <td data-label="Required Fields" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e199 ">
              <ul>
                <li><code>recommenderName</code></li>

                <li><code>products[].id</code></li>

              </ul>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e202 ">Fires when a shopper views a page containing recommendations. Make sure the
              <code>recommenderName</code> matches the recommender configured in Business
              Manager.
            </td>

          </tr>
          <tr class="">
            <td data-label="Activity Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e196 "><code>clickReco</code></td>

            <td data-label="Required Fields" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e199 ">
              <ul>
                <li><code>recommenderName</code></li>

                <li><code>products[].id</code></li>

                <li><code>products[].sku</code></li>

              </ul>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e202 ">Fires when a shopper clicks a recommended product. Required for recommendation
              click-through attribution.</td>

          </tr>
          <tr class="">
            <td data-label="Activity Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e196 "><code>addToCart</code></td>

            <td data-label="Required Fields" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e199 ">
              <ul>
                <li><code>product.id</code></li>

                <li><code>product.sku</code></li>

                <li><code>product.alt_id</code></li>

              </ul>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e202 ">Fires when a shopper adds a product to their cart. Required for cart-related
              attribution.</td>

          </tr>
          <tr class="">
            <td data-label="Activity Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e196 "><code>finishCheckout</code></td>

            <td data-label="Required Fields" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e199 ">
              <ul>
                <li><code>products[].id</code></li>

                <li><code>products[].sku</code></li>

                <li><code>products[].price</code></li>

                <li><code>products[].quantity</code></li>

              </ul>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e202 ">Fires when a shopper completes an order. Required for revenue attribution and
              conversion tracking.</td>

          </tr>
          <tr class="">
            <td data-label="Activity Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e196 "><code>viewCategory</code></td>

            <td data-label="Required Fields" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e199 ">
              <ul>
                <li><code>category.id</code></li>

              </ul>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e202 ">Fires when a shopper views a category grid page.</td>

          </tr>
          <tr class="">
            <td data-label="Activity Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e196 "><code>viewSearch</code></td>

            <td data-label="Required Fields" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e199 ">
              <ul>
                <li><code>searchText</code></li>

              </ul>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e202 ">Fires when a shopper views search results.</td>

          </tr>
          <tr class="">
            <td data-label="Activity Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e196 "><code>clickCategory</code></td>

            <td data-label="Required Fields" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e199 ">
              <ul>
                <li><code>category.id</code></li>

                <li><code>product.id</code></li>

              </ul>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e202 ">Fires when a shopper clicks from a category page to a product detail
              page.</td>

          </tr>
          <tr class="">
            <td data-label="Activity Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e196 "><code>clickSearch</code></td>

            <td data-label="Required Fields" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e199 ">
              <ul>
                <li><code>searchText</code></li>

                <li><code>product.id</code></li>

              </ul>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d236845e202 ">Fires when a shopper clicks from search results to a product detail
              page.</td>

          </tr>
        </tbody>
      </table>

## Troubleshooting

If activities aren't appearing in Einstein dashboards, check for these common issues:

- **Non-production instance type**—Einstein doesn't generate reports for activities with `instanceType` values other than `prd`.
- **Missing or empty activity types**—Einstein doesn't report on activities without a valid `activityType`.
- **Missing recommender names**—for`viewReco`, `clickReco`, and recommendation-to-cart activities, a missing `recommenderName` prevents proper attribution.
- **Invalid product IDs**—make sure that the product IDs match the IDs in your product catalog.

Use the [B2C Commerce Recommendation Validator](https://help.salesforce.com/s/articleView?id=cc.b2c_einstein_recommendation_validator.htm&release=264.0.0&type=5 "The Einstein Recommendation Validator is a Chrome extension that validates and debugs B2C Commerce Einstein recommendations and sorting rules in your marketplace. Use this extension to verify Einstein site activity tracking and recommendations.") Chrome extension to inspect activity data being sent from your storefront.

#### See Also

- [Validator Responses in B2C Commerce Einstein](https://help.salesforce.com/s/articleView?id=cc.b2c_einstein_validator_responses.htm&release=264.0.0&type=5 "When you navigate to a site that's using B2C Commerce Einstein features, Validator instantly validates recommendation activities and sorting rules. The tool then provides particular responses, based on the activity it registers.")
- [Common Recommendation Validator Errors in Commerce Einstein](https://help.salesforce.com/s/articleView?id=cc.b2c_common_validator_errors.htm&release=264.0.0&type=5 "Here are some of the common errors that sometimes occur, and how to fix them, when using the Recommendation Validator in B2C Commerce Einstein.")
- [B2C Commerce Einstein Recommendation Validator](https://help.salesforce.com/s/articleView?id=cc.b2c_einstein_recommendation_validator.htm&release=264.0.0&type=5 "The Einstein Recommendation Validator is a Chrome extension that validates and debugs B2C Commerce Einstein recommendations and sorting rules in your marketplace. Use this extension to verify Einstein site activity tracking and recommendations.")