Adobe Commerce Event Collector
This package listens for and handles events sent from the Adobe Commerce Events SDK. It runs as a side effect and is meant to be a convenience for users who want to send events to Adobe Commerce for processing.
Installation
The collector can be used as a hosted script, or bundled in a JavaScript application. The script version is hosted on cdn, and the bundled version is hosted on npm.
To load the SDK as a script, use the following snippet.
Copied to your clipboard<script src="https://cdn.jsdelivr.net/npm/@adobe/magento-storefront-events-sdk@1/dist/index.js"></script>
To install the script as a dependency, run this command.
Copied to your clipboardnpm install @adobe/magento-storefront-event-collector
[!NOTE]
To avoid any issues, make sure you keep the script or bundled version up to date with the latest release.
Quick Start
After loading the collector script, or importing the package as shown below, there is nothing else to configure.
Copied to your clipboardimport "@adobe/magento-storefront-event-collector";
The collector then begins listening for events. When these events are fired, the collector runs the associated handler and sends the event along with any relevant information to Adobe Commerce for further processing.
Supported events
The list of supported events can differ between eventing frameworks. The following tables describe the events supported on each framework and the equivalent event names.
Event names by framework
Event | Storefront Events SDK (adobeDataLayer) | Commerce (Snowplow) | Adobe Experience Platform |
---|---|---|---|
add to requisition list | addToRequisitionList | ❌ | xdm namespace: commerce xdm type: requisitionListAdds |
cart open | openCart | ❌ | xdm namespace: commerce xdm type: productListOpens |
cart view | shoppingCartView | category: shopping-cart action: view | xdm namespace: commerce xdm type: productListViews |
complete checkout | placeOrder | category: checkout action: place-order | xdm namespace: commerce xdm type: purchases |
create account | createAccount | ❌ | xdm namespace: userAccount xdm type: createProfile |
create requisition list | createRequisitionList | ❌ | xdm namespace: commerce xdm type: requisitionListOpens |
edit account | editAccount | ❌ | xdm namespace: userAccount xdm type: updateProfile |
page view | pageView | category: --- action: Pageview | xdm namespace: web.webpagedetails xdm type: pageViews |
product adds to cart | addToCart | category: product action: add-to-cart | xdm namespace: commerce xdm type: productListAdds |
product remove from cart | removeFromCart | ❌ | xdm namespace: commerce xdm type: productListRemovals |
product view | productPageView | category: product action: view | xdm namespace: commerce xdm type: productViews |
recommendation item add to cart | recsItemAddToCartClick | category: recommendation-unit action: rec-add-to-cart-click | ❌ |
recommendation item click | recsItemClick | category: recommendation-unit action: rec-click | ❌ |
recommendation request sent | recsRequestSent | category: recommendation-unit action: api-request-sent | ❌ |
recommendation response received | recsResponseReceived | category: recommendation-unit action: api-response-received | ❌ |
recommendation unit render | recsUnitRender | category: recommendation-unit action: impression-render | ❌ |
recommendation unit view | recsUnitView | category: recommendation-unit action: view | ❌ |
remove from requisition list | removeFromRequisitionList | ❌ | xdm namespace: commerce xdm type: requisitionListRemovals |
search category click | searchCategoryClick | category: search action: category-click | ❌ |
search product click | searchProductClick | category: search action: product-click | ❌ |
search request sent | searchRequestSent | category: search action: api-request-sent | xdm namespace: --- xdm type: searchRequest |
search response received | searchResponseReceived | category: search action: api-response-received | xdm namespace: --- xdm type: searchResponse |
search results view | searchResultsView | category: search action: results-view | ❌ |
sign in | signIn | ❌ | xdm namespace: userAccount xdm type: login |
sign out | signOut | ❌ | xdm namespace: userAccount xdm type: logout |
start checkout | initiateCheckout | category: shopping-cart action: initiate-checkout | xdm namespace: commerce xdm type: checkouts |
Event support by framework
Event | Luma/PHP ("Snowplow") | Luma/PHP Adobe Experience Platform | PWA Commerce ("Snowplow") | PWA Adobe Experience Platform |
---|---|---|---|---|
add to requisition list | ❌ | PDP PLP Cart Account | ❌ | ❌ |
cart open | ❌ | PDP PLP (Browse) PLP (Search results) Cart | ❌ | ❌ |
cart view | Cart | Cart | Cart | Cart Mini cart |
complete checkout | Checkout | Checkout | Checkout | Checkout |
create account | ❌ | Account | ❌ | Account |
create requisition list | ❌ | PDP PLP Cart Account | ❌ | ❌ |
edit account | ❌ | Account | ❌ | Account |
page view | Landing page PDP PLP (Browse) PLP (Search results) Cart Checkout | Landing page PDP PLP (Browse) PLP (Search results) Cart Checkout | Landing page PDP PLP (Browse) PLP (Search results) Cart Checkout | Landing page PDP PLP (Browse) PLP (Search results) Cart Checkout |
product add to cart | PDP PLP (Browse) PLP (Search results) Cart | PDP PLP (Browse) PLP (Search results) Cart | PDP | PDP |
product remove from cart | ❌ | Cart | ❌ | ❌ |
product view | PDP | PDP | PDP | PDP |
recs item add to cart | Recs carousel | ❌ | Recs carousel | ❌ |
recs item click | Recs carousel | ❌ | Recs carousel | ❌ |
recs request sent | Recs carousel | ❌ | Recs carousel | ❌ |
recs response received | Recs carousel | ❌ | Recs carousel | ❌ |
recs unit render | Recs carousel | ❌ | Recs carousel | ❌ |
recs unit view | Recs carousel | ❌ | Recs carousel | ❌ |
remove from requisition list | ❌ | Account | ❌ | ❌ |
search category click | Search popover | ❌ | ❌ | ❌ |
search product click | Search popover | ❌ | ❌ | ❌ |
search request sent | Search popover PLP (Browse) PLP (Search results) | Search popover PLP (Browse) PLP (Search results) | ❌ | ❌ |
search response received | Search popover PLP (Browse) PLP (Search results) | Search popover PLP (Browse) PLP (Search results) | ❌ | ❌ |
search results view | Search popover PLP (Browse) PLP (Search results) | ❌ | ❌ | ❌ |
sign in | ❌ | Account | ❌ | Account |
sign out | ❌ | Account | ❌ | ❌ |
start checkout | Cart | Cart | Cart | Cart Mini cart |
Support
If you have any questions or encounter any issues, reach out here: