Listening to your users: Inferring Affinities and Interests based on actual time spent vs clicks or pageloads

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.

TimestampSession_idEventCategoryBook title
12:30:24session_id1viewBiography & Autobiography > Personal MemoirsEat Pray Love
12:31:29session_id1viewDrama > American > GeneralDeath of a Salesman
13:48:49session_id2viewScience > Physics > GeneralPhysics of the Impossible
13:49:02session_id2viewBiography & Autobiography > Personal MemoirsEat Pray Love
13:49:09session_id2viewHealth & Fitness > Diet & Nutrition > NutritionThe Omnivore’s Dilemma
13:49:19session_id2viewHealth & Fitness > Diet & Nutrition > NutritionThe Omnivore’s Dilemma
13:49:35session_id2viewPoetry > American > GeneralLeaves of Grass
14:09:47session_id2viewPoetry > American > GeneralLeaves of Grass
14:10:02session_id2add_to_cartPoetry > American > GeneralLeaves 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:

RankCategorySession count
1Biography & Autobiography > Personal Memoirs2
2Health & Fitness > Diet & Nutrition > Nutrition1
3Poetry > American > General1
4Science > Physics > General1

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:

RankCategoryTime spent
1Poetry > American > General1212
2Biography & Autobiography > Personal Memoirs72
3Health & Fitness > Diet & Nutrition > Nutrition26
4Science > Physics > General13

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:

categorysession count
Juvenile Fiction > People & Places > United States > African American5358
Juvenile Fiction > Girls & Women5291
Juvenile Fiction > Family > General5265
Fiction > Contemporary Women5215
Fiction > Thrillers > Suspense4971
Fiction > Mystery & Detective > Women Sleuths4804

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).

categorytime spent
Juvenile Fiction > People & Places > United States > African American102164972
Juvenile Fiction > Family > General100447985
Fiction > Contemporary Women98897169
Juvenile Fiction > Girls & Women98340874
Fiction > Thrillers > Suspense91140081
Fiction > Mystery & Detective > Women Sleuths87372604

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.

categorytime score
Juvenile Fiction > People & Places > United States > African American28461106.29
Fiction > Contemporary Women28179308.93
Juvenile Fiction > Girls & Women28068989.26
Juvenile Fiction > Family > General27608048.02
Fiction > Thrillers > Suspense26102829.31
Fiction > Mystery & Detective > Women Sleuths24597921.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:

blog_post_time_spent_top20

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.

blog_post_time_spent_ranking_plot

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.