Personalized recommendations rely on the idea the you know the interests of your audience. In absence of explicit feedback, interests are generally derived from clickstream data: session and event (e.g. click) data. But given that sessions can be short lived (bounce) and clicks can be unintentional, they are unlikely to reflect true interests of your audience if you simply count them.
At Blueshift, we choose to actively follow along the individual’s storyline and extract intelligence from each event to gather insights of the user’s intent and interests, so we can provide better recommendations.
Let’s look at a real user example
In the table below, we see an actual clickstream of events from a user on blueshiftreads.com.
|12:30:24||session_id1||view||Biography & Autobiography > Personal Memoirs||Eat Pray Love|
|12:31:29||session_id1||view||Drama > American > General||Death of a Salesman|
|13:48:49||session_id2||view||Science > Physics > General||Physics of the Impossible|
|13:49:02||session_id2||view||Biography & Autobiography > Personal Memoirs||Eat Pray Love|
|13:49:09||session_id2||view||Health & Fitness > Diet & Nutrition > Nutrition||The Omnivore’s Dilemma|
|13:49:19||session_id2||view||Health & Fitness > Diet & Nutrition > Nutrition||The Omnivore’s Dilemma|
|13:49:35||session_id2||view||Poetry > American > General||Leaves of Grass|
|14:09:47||session_id2||view||Poetry > American > General||Leaves of Grass|
|14:10:02||session_id2||add_to_cart||Poetry > American > General||Leaves of Grass|
This specific user interacted during two different sessions, browsing books from different categories. If we try to come up with the top categories for this user, based on total number of sessions, we get:
|1||Biography & Autobiography > Personal Memoirs||2|
|2||Health & Fitness > Diet & Nutrition > Nutrition||1|
|3||Poetry > American > General||1|
|4||Science > Physics > General||1|
As you can see in the table above, Personal Memoirs is the top category while the three other categories tie to second-place (they have been alphabetically ordered in that case), but other tie-breaking rules can be applied.
Time spent ranking
At Blueshift, we developed algorithms to re-rank these categories according to the time the user actually spent on your products and categories:
|1||Poetry > American > General||1212|
|2||Biography & Autobiography > Personal Memoirs||72|
|3||Health & Fitness > Diet & Nutrition > Nutrition||26|
|4||Science > Physics > General||13|
Here, we rank ‘Poetry > American > General’ above the other categories. Note that at the end of the original event stream above, the user actually did add the book from that category to the cart. Even if we would have ignored that event, our time based ranking would have indeed capture a category of interest to this user.
There’s more: decayed time spent
You should be careful not to rely on detailed information from a single user on a single day: if the user indeed bought the book he added to the cart, that might just be an indicator of no longer being interested in that specific category of products. Furthermore, you would want to adapt to changing user interest over time.
That’s why we implemented what we call a decayed time spent algorithm, that combines the time spent by users over a certain period of time (say last week) and that weighs recent time spent as more important to the ranking than time the user spent before (say 14 days ago).
Decayed weighting of recency this way allows recommendations to adapt quickly to shifting user interests when they are shopping during holidays and might be looking for gifts for others as well as themselves.
From user-level signal to site-wide signal
Many product recommendations are related to some site-wide top categories of products, like ‘top viewed’. Using our time based algorithms, we can better rank these top categories. Let’s look at another example from blueshiftreads.com where we show you a part (20-25 to be exact) of the top 25 most popular categories.
Using classical session counting, we obtain the following ranking:
|Juvenile Fiction > People & Places > United States > African American||5358|
|Juvenile Fiction > Girls & Women||5291|
|Juvenile Fiction > Family > General||5265|
|Fiction > Contemporary Women||5215|
|Fiction > Thrillers > Suspense||4971|
|Fiction > Mystery & Detective > Women Sleuths||4804|
However, when we rerank these categories based on actual time spent by the users, we see that ‘Juvenile Fiction > Girls & Woman’ drops from position 21 (above) to position 23 (below), even though it had 76 user sessions more in the 7 days over which this was calculated. User sessions are no guarantee for actual interest (i.e spending time).
|Juvenile Fiction > People & Places > United States > African American||102164972|
|Juvenile Fiction > Family > General||100447985|
|Fiction > Contemporary Women||98897169|
|Juvenile Fiction > Girls & Women||98340874|
|Fiction > Thrillers > Suspense||91140081|
|Fiction > Mystery & Detective > Women Sleuths||87372604|
Furthermore, if we rank the categories using our decayed time spent, we see that ‘Fiction > Contemporary Women’ is actually ranked the highest (21) while it was the lowest (23) in the original list. This indicates that this category received the highest time spend by users in the most recent past.
|Juvenile Fiction > People & Places > United States > African American||28461106.29|
|Fiction > Contemporary Women||28179308.93|
|Juvenile Fiction > Girls & Women||28068989.26|
|Juvenile Fiction > Family > General||27608048.02|
|Fiction > Thrillers > Suspense||26102829.31|
|Fiction > Mystery & Detective > Women Sleuths||24597921.38|
Ok, why bother?
So why bother re-ranking? Well, most catalogs will exhibit a Long Tail in the distribution of popularity of their content: very few items will be very popular while lots of items will be very unpopular. No matter how you rank the popularity of the top-10 categories (sessions, clicks, time, …) out of a 1000 category catalog, these extremely popular categories will always on top. Just have a look at the top 20 categories from blueshiftreads.com:
As you can see, the top 5 categories do a lot better than the rest. For most businesses there is a lot of value in promoting content from categories other than these few favorites. Therefore, if you can avoid down-ranking interesting categories for users and do this consistently over your whole catalog, you will be able to recommend products from the appropriate category to the users who care for it. In other words, you will avoid the pitfall of recommending an overly popular yet generic product to your users.
But time spent relates to sessions/clicks anyway?
Yes and no. It is true that more sessions correlate to more time users will spend on categories, but not to the same extent: a session length can range from a second to tens of minutes. Have a look at the next graph below.
What we see is the ranking of the 1000+ categories (on the X-axis) for blueshiftreads.com by popularity (on the Y-axis, logarithmic scale) over 7 days, in terms of 3 different metrics:
- The blue line represents ranking by session count. It is very smooth because it really ranks all categories just in descending order of session count. This is the standard ranking.
- The red line represents ranking by time spent by the users. It is equally smooth in the beginning (left) because it ‘agrees’ with the session ranking: as mentioned above, the top popular categories will always be on top. But quite soon, the line becomes spiky: the ranking disagrees with session count, and the spikes indicate that this ranking would reorder the categories in a different way (promoting different categories to the top).
- The green line is the decayed time spent ranking: the same holds as the time spent ranking. This algorithm also disagrees with session count and would reorder lots of categories in the long tail to promote categories of interest to the user.
This re-ranking is exactly what you should do to stop recommending the same popular categories to users that might have indicated (time) interest in other categories.