Live Search Events
Live Search uses events to power search algorithms such as “Most Viewed”, and “Viewed This, Viewed That”. While LUMA users get eventing out of the box, headless and other custom implementations have to implement eventing for their own needs.
Since Live Search and Product Recommendations use the same backend algorithm, some events are shared by both services. Some Product Recommendations events are required to populate the Recommendations Dashboard.
Events
This table describes the events used by Live Search strategies.
Product Recs
product view
Product Recs
complete checkout
Product Recs
add to cart
Product listing page
Cart
Wish List
Product Recs
product view
Product Recs
product view
product view
Cart/Checkout
product view
product view
complete checkout
product view
add to cart
Product listing page
Cart
Wishlist
Required dashboard events
Some events are required to populate the Live Search dashboard
page-view
, search-request-sent
,page-view
, search-request-sent
,page-view
, search-request-sent
,page-view
, search-request-sent
,page-view
, search-request-sent
, search-response-received
, search-results-view
, search-product-click
page-view
, search-request-sent
, search-response-received
, search-results-view
, search-product-click
page-view
, search-request-sent
, search-response-received
, search-results-view
, search-product-click
, product-view
, add-to-cart
, place-order
Required contexts
All events require the Page
and Storefront
contexts. This should happen at the page level/storefront application layer rather than when generating individual events (for example, in a PHP storefront, the PHP application container is responsible for setting them at runtime).
Usage
Here is a sample implementation of the search-request-sent
event:
const mse = window.magentoStorefrontEvents;
/* set in application container */
// mse.context.page(pageCtx);
// mse.context.setStorefrontInstance(storefrontCtx);
/* set before firing event */
mse.context.setSearchInput(searchInputCtx);
mse.publish.searchRequestSent("search-bar");
Caveats
Ad blockers and privacy settings can prevent events from being captured and might cause the engagement and revenue metrics to be under-reported.
Eventing does not capture every transaction happening on the merchant’s site. Eventing is meant to give the merchant a general idea of events that are happening on the site.
Headless implementations must implement eventing to power the Product Recommendations dashboard.