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:
| Activity Type | Required Fields | Notes |
|---|---|---|
viewProduct |
|
Fires when a shopper views a product detail page. Enables recently viewed recommenders and real-time personalization. |
viewReco |
|
Fires when a shopper views a page containing recommendations. Make sure the
recommenderName matches the recommender configured in Business
Manager.
|
clickReco |
|
Fires when a shopper clicks a recommended product. Required for recommendation click-through attribution. |
addToCart |
|
Fires when a shopper adds a product to their cart. Required for cart-related attribution. |
finishCheckout |
|
Fires when a shopper completes an order. Required for revenue attribution and conversion tracking. |
viewCategory |
|
Fires when a shopper views a category grid page. |
viewSearch |
|
Fires when a shopper views search results. |
clickCategory |
|
Fires when a shopper clicks from a category page to a product detail page. |
clickSearch |
|
Fires when a shopper clicks from search results to a product detail page. |
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
instanceTypevalues other thanprd. - 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 missingrecommenderNameprevents proper attribution. - Invalid product IDs—make sure that the product IDs match the IDs in your product catalog.
Use the B2C Commerce Recommendation Validator Chrome extension to inspect activity data being sent from your storefront.