Live Search Events

Last update: 2023-11-21
  • Created for:
  • Admin

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.

Strategy Products Events Page
Most Viewed Live Search
Product Recs
page view
product view
Product detail page
Most Purchased Live Search
Product Recs
page view
complete checkout
Cart/Checkout
Most added to cart Live Search
Product Recs
page view
add to cart
Product detail page
Product listing page
Cart
Wish List
Viewed this, viewed that Live Search
Product Recs
page view
product view
Product detail page
Trending Live Search
Product Recs
page view
product view
Product detail page
Viewed this, bought that Product Recs page view
product view
Product detail page
Cart/Checkout
Bought this, bought that Product Recs page view
product view
Product detail page
Conversion: View to purchase Product Recs page view
product view
Product detail page
Conversion: View to purchase Product Recs page view
complete checkout
Cart/Checkout
Conversion: View to cart Product Recs page view
product view
Product detail page
Conversion: View to cart Product Recs page view
add to cart
Product detail page
Product listing page
Cart
Wishlist
NOTE

Data collection for the purposes of Live Search does not include personally identifiable information (PII). All user identifiers, such as cookie IDs and IP addresses, are strictly anonymized. Learn more.

Required dashboard events

Some events are required to populate the Live Search dashboard

Dashboard area Events
Unique searches search-request-sent,search-response-received
Zero results searches search-request-sent,search-response-received
Zero results rate search-request-sent,search-response-received
Popular searches search-request-sent,search-response-received
Avg. click position search-request-sent,search-response-received, search-results-view, search-product-click
Click-through rate search-request-sent,search-response-received, search-results-view, search-product-click
Conversion rate 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.

NOTE

If Cookie Restriction Mode is enabled, Adobe Commerce does not collect behavioral data until the shopper consents to using cookies. If Cookie Restriction Mode is disabled, Adobe Commerce collects behavioral data by default.

On this page