The adapter pattern decouples analytics components from vendor-specific event APIs. Components call a generic interface and the adapter translates those calls into the vendor’s API. Storefront Next provides three built-in adapters for analytics event tracking that use Einstein, Active Data, and Data 360 (formerly Data Cloud).
Adapter
Purpose
Config key
Einstein
Analytics event tracking (viewProduct, addToCart, and so on)
engagement.adapters.einstein
Active Data
Analytics event tracking (dwac beacon)
engagement.adapters.activeData
Data 360
Salesforce Data 360 — view/impression events only
engagement.adapters.data360
All three implement the EngagementAdapter interface and are registered in a shared store.
If an adapter’s enabled flag is false, it isn’t registered.
Data 360 maps only view and impression events — view_page, view_product, view_search, view_category, and view_recommender. Cart, checkout, wishlist, and click events have no Data 360 mapping and ship disabled in eventToggles.
1import{resetAdaptersInitialization}from "@/lib/adapters/engagement/initialize";23afterEach(()=> resetAdaptersInitialization()); // Clear cached promise for clean state
Add an Engagement Adapter
Create src/lib/adapters/engagement/your-adapter.ts with a factory function returning EngagementAdapter.
Register it in src/lib/adapters/engagement/register.ts inside initializeEngagementAdapters().
Add configuration under engagement.adapters.yourAdapter in config.server.ts.