6 min read

Enhance search relevance with Contextualize

Improved results ranking with query context

Since context is one of the main factors affecting your shoppers' needs and preferences, understanding how they navigate through your commerce store and interact with products is key to offering them a meaningful shopping journey. Empathy Platform's Contextualize service leverages information from shoppers' behavior when navigating and interacting with your commerce store to improve the product ranking on the search engine results page (SERP) for every query entered and enhance your shoppers' search experience.


Collective shopper behavior as a foundation
Every shopper's action matters to offer contextualized and trustworthy search and discovery experiences based on your shoppers' preferences and favorite products. Wisdom of the crowd refers to the general context that surrounds the shoppers' interactions with your commerce store, such as search queries, actions on results, and navigation. The wisdom of the crowd is generated from the anonymized collective shopping signals, also known as search events, collected by the Tagging microservice. The elements considered as search events are:

  • Query: the term entered in the search box that launches a search.
  • Click: the click action on a product result from the SERP.
  • Add-to-cart: the action of adding a product to the shopping cart from the SERP or the product detail page (PDP).
  • Checkout: the action of completing the purchase of a product selected from the SERP or the PDP.


Keep on reading about the tagging events and their different applications to enhance shoppers' search and discovery experience.

Contextualize leverages the wisdom of the crowd to generate dynamic relevance models based on the query context, providing context-rich insights about the shopper's intent for a specific query. Query context is the data generated for a query from different shoppers' interactions processed to create a customized shoppers' intent model with the most recurrent products and product attributes.

The context-rich relevance models help improve the results' relevance for each query term depending on the configured product attributes (size, color, style, etc.), helping shoppers to find the products that best suit their preferences and increasing product findability.

Need an example to throw light on query context?

Imagine that a shopper is navigating through your gardening store looking for a pot for their favorite plant. They want a 5L pot and look for "pot" in the search bar. As it's a broad search, they don't find what is expected and just click randomly a couple of flowerpots. The next search is "little pot", but the relevance of the search results is not the desired one since there's a brand called Little garden with pots of all sizes.

After scrolling and browsing between pages, the shopper finds several pots that fit their needs and ends up adding one to the cart. Navigating through the menu in the small pots section, the shopper finds another interesting pot, which is also added to the cart.

It's important to know that this commerce store's been configured to tag and weight fields or attributes such as size and material of the pots, and also events like clicks, add2cart, browseProduct, and browseAdd2cart, being the last two related to browsing during navigation and interactions with products.

In this example, the query context generates two models for the two queries received: "pot" and "little pot". All the interactions that the shopper has made in the same query are brought together.

Then, the product attributes tagged are plastic and clay. In addition, clicks, add2carts, browseProducts, and browseAdd2Cart are the tagged events. The products clicked are also tagged.

Finally, all this data retrieved is used to generate a final query context model for the query "pot".

Privacy-first data processing
The data collected from shoppers' interactions is not linked to a shopper profile or account. Insights from anonymized collective shopping signals are leveraged to rank first highly trending and popular products, commonly bought together items, and contextually related results without compromising data privacy.

As part of Empathy's privacy-first vision, the shopper context approach is not contemplated as a way of shopping experience personalization since Empathy doesn't capture, manage, or store any shoppers' personal data, even when they give their active consent.


Get more insights about why privacy matters when tracking collective shopper behavior.

Spot the difference

Although Contextualize enhances search results relevance and offers organic suggestions based on data retrieved from shoppers, the data is collective and anonymized, linked only to each query, and compliant with Empathy's privacy-first commitment. No personal data is collected during the session since a session ID is used to correlate shopper interactions.

With in-session personalization, suggestions and enhancements in product ranking link directly to the behavioral shopper's interactions with your commerce store during a session where they've signed in to their accounts or profiles. Data such as their favorite product's attributes—size, color, and style— or favorite products and other interactions are retrieved, managed, and stored being linked to the user's profile, so this information is not anonymized.


Empathy.co is exploring other possibilities on custom personalizations without compromising the shopper's privacy, like consent-based data collection. Meanwhile, check out the Empathy's perspective about in-session contextualization (opens new window) (opens a new window).

Try Contextualize to...

  • Understand your shoppers' intents and preferences to offer them more relevant results.
  • Improve product ranking by positioning trending and popular products first.
  • Weight relevance of product attribute values according to shoppers' behavior.
  • Adequate the search results ranking to current trends.
  • Guarantee shoppers' privacy by anonymized and generalized data collection.

The inner workings of Contextualize

Contextualize can be defined as the anonymized shoppers' behavioral interactions collected that relate to each query. Data is leveraged to enhance the ranking of product results and attribute weighting relevance, improving the overall search experience.

In the first place, the Tagging microservice tracks shoppers' behavior in a store by adding snippets of code to the site to capture certain events.

The Contextualize microservice and its batch process generate relevance models with some of the events collected based on the wisdom of the crowd. The events processed are click, add2cart, and checkout, all of them linked to a query. The events used to generate the intent relevance models and other parameters can be customized according to the specific needs of the customers through the Instance Management Console.


Keep on reading about how to set up search events when configuring the Contextualize batch process.

The dynamic relevance models modify the product ranking by adding points to the overall product scoring based on the shopper-intent interactions. Contextualize gives then an extra boost to the product itself or a specific product attribute value (for example, red value for color attribute).

Once the relevance models are created, they are retrieved by the Search microservice to be applied at query time, dynamically changing the results' order. Through the Empathy Platform Playboard's Explain tool, you can understand the nuances of how and why products are ranked the way they are.