Hello, is it me you're looking for?
Hello, is it me you're looking for?
Many times when users are searching on websites, they don’t use the search box at first, but just play around, scrolling up and down, navigating through category pages, looking for products they want.
In this case they have an idea about what they’re looking for, but if relevant products don’t show up in the first results, it’s unlikely that the journey will conclude with a checkout. This happens because without a query to provide context, the journey becomes lost in a display of results that don’t match what the user implicitly wishes to see.
At Empathy.co we have developed the Category Context, a service that can help in this situation. It analyzes the user behaviour when browsing through category pages and clicking on products. It thus creates a rank, depending on the category currently considered.
At first, the strategy to sort products by categories might sort them in alphabetical order, use some variable to see whether or not the product has a discount, and put offer products first. But now let’s suppose that you can have a laptop whose name starts with Z and has not a discount. With this sorting, it’s impossible for this product to appear in the first positions of the product list. So potential clients won’t be seeing it and hence won’t buy it.
Category context will help to improve this situation, ranking products in each category according to the past user interactions with products, using either clicks or purchases.
Usually, a product belongs to more than one category, but that doesn’t mean its relevance is the same in all categories; it is useful to know in which category a product should have more weight. Our gaming laptop may be in two categories, Laptops and Gaming PC.
In this case with category context, the API will return the relevance that this product will have in each category so when users are searching through the Gaming PCs category, the Best Gaming Laptop will appear in the first results, because it best suits the needs of the clients.
However, in Laptops this product will have less relevance and it won’t appear in the first results.
Now let’s create a simple Python script to access the Category Context data and see what it looks like. We only have to send the product identifiers to the scores endpoint and the return will be the weight the product has for each category, for every category in which it belongs.
Then, this information can be used to sort our category grid or we can use it to multiply the results from a previous calculation of the product’s weights in each category.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import requests, logging
categoryContextUrl = "https://api.empathybroker.com/contextsearch/v2/categoryContext/scores?"
#Method to get the Category Context
def getCategoryContext(pids):
#Do de http request
response=requests.get(categoryContextUrl,params=pids)
if response.status_code != 200:
logging.info("Error %s in the category context request",response.status_code)
return response.json() #return the response in json format
def main():
#Query params to the URL
productsIds={"pid":["201331,1265192"]}
getCategoryContext(pids=productsIds)
"""
Response content
[
{ "productId": "pid1",
"scores": [
{
"categoryId": "1",
"weight": 50.0
} ,
{
"categoryId": "2",
"weight": 10.0
}
]
},
{ "productId": "pid2",
"scores": [
{
"categoryId": "3",
"weight": 100.0
}
]
}
]
"""
if __name__ == "__main__":
main()
Another great feature of Category Context is that it’s also totally integrated with our Multivariate Testing Tool. It allows merchants to easily validate the Category Context performance, defining control groups, splitting traffic, etc. We already wrote another post about this, if you want to explore it deeply here it is.
Now that you know how category context works you should read this post from my colleague Álvaro explaining how to apply contextualization to the search experience.