Data
What Customer Behaviour Data Is Actually Telling You
Clicks are not preferences, dwell time is not interest, and your conversion funnel is mostly measuring your own UI. A field guide to reading behavioural logs honestly.
Behavioural data has a seductive quality: it feels objective. Nobody lied on a survey, nobody misremembered. The person clicked or they didn't, and the database recorded it.
Then you build a model on it and the model learns something strange, it pushes accessories at people browsing outerwear, or it decides that your most engaged users are the ones who can't find anything.
Both of those happened to me. What I eventually understood is that a behavioural log is not a record of what people wanted. It is a record of what your interface made easy, filtered through what your tracking happened to capture. Preference is in there somewhere, underneath both.
Here is how I try to read it now.
#Position is a confound, not a feature
The single largest predictor of whether an item gets clicked is where it was shown. This is not news to anyone who has worked on ranking, and yet it sneaks into every first model, because position is not usually in the training data as a column, it is baked into the labels.
Your current ranker put an item at position one. It got clicked. You record a positive. You retrain. The new model learns that this item is good. It puts it at position one. It gets clicked.
You have built a machine for agreeing with yourself.
The cheap mitigation is to log the rank of every impression and include it as a feature during training, then set it to a constant at serving time. The model learns "this got clicked despite being at position nine", which is a genuinely different and more useful signal. It is not a complete solution, proper treatment needs randomised exploration, but it costs one column and removes the worst of the feedback loop.
#Dwell time measures confusion as often as interest
I spent a while treating long page dwell as a strong positive. It is intuitive: someone lingering is someone interested.
Then I segmented dwell by what happened next. Two populations:
- Long dwell → add to cart. Interest. The signal works as expected.
- Long dwell → back to listing → different item → back again. Not interest. That is someone who cannot find the size chart, or cannot tell from the photos whether the colour is navy or black.
The second group had higher average dwell than the first. A model trained on raw dwell will enthusiastically recommend your most confusing products.
Dwell only becomes a usable signal in combination with the next action. On its own it is a measure of friction, which is a genuinely useful thing to track, just not as a preference label.
#Absence of an event is not absence of interest
This one is structural and there is no clean fix, only honesty about it.
When a user does not click an item, you record nothing, and in training that becomes a negative. But there are at least four reasons for not clicking:
- They saw it and didn't want it. A real negative.
- They saw it, wanted it, and already own it.
- It rendered below the fold and they never saw it at all.
- They wanted it but the price was wrong today.
Only the first is a negative in the sense your loss function assumes. Case three is the big one. Treating unseen items as rejected is how models learn to be conservative, because everything novel is drowning in false negatives.
The minimum viable fix is to log viewport impressions, not just rendered impressions, and only treat genuinely-seen-and-not-clicked as negative. On the storefront I ran, this cut the negative set by roughly half and noticeably improved how willing the model was to surface anything outside the top sellers.
#Your funnel is mostly a picture of your UI
A conversion funnel tells you where people stop. It is routinely read as a statement about customer intent, when it is usually a statement about interface design.
An abandoned checkout can mean price shock, or it can mean the payment provider's 3-D Secure step times out on slow connections. A low add-to-cart rate on mobile can mean mobile users are less committed, or it can mean the button sits under the floating chat widget on a 360 px screen.
The discipline that helped: before attributing a funnel number to customer psychology, reproduce the step on the worst device and network you support. More than once the psychological explanation evaporated on contact with a throttled connection.
#Four questions that beat most feature engineering
When I pick up a behavioural dataset now, I ask these before writing any model code.
1. Who is missing from this table? Every log has a population it structurally cannot see. Users who bounced in under a second. People with tracking blocked. Anyone whose session crashed. If that group behaves differently from the rest, your model is being trained on a biased sample and no amount of regularisation fixes that.
2. What did the interface make easy on the day this was logged? Logs span UI changes. A spike in an event six months ago may be a redesign, not a behaviour shift. Keeping a dated changelog of UI releases alongside the data has saved me from several confident, wrong conclusions.
3. Which events share a name but not a meaning? search from the header, search
from the empty-results page and search from an autocomplete selection are three
different intents. One name, three populations.
4. What would this user have done if we had shown them nothing? The counterfactual is the only thing that makes a recommendation valuable. If someone would have bought the item anyway, your model gets credit for a sale it did not cause. This is why offline uplift always flatters you and why the only honest measurement is a holdout group that sees no personalisation at all.
#Seasonality will fool you twice
Behavioural data has a time axis and it is rarely treated with the suspicion it deserves.
The first way it fools you is the obvious one: you train on a window that happens to contain a festival, a sale, or a weather shift, and the model learns that the world looks like that. Deploy it six weeks later and it is confidently optimising for conditions that no longer exist. On a clothing catalogue this is brutal, a model trained across a monsoon window will keep pushing rainwear into a dry month.
The second way is subtler and caused me more trouble. Different user segments have different seasons. Aggregate seasonality is an average of several populations that peak at different times, and the average describes none of them. Gift buyers and self-buyers behave in nearly opposite ways in the run-up to a festival: one browses broadly across categories they never otherwise touch, the other narrows. Modelled together, they produce a mush that serves neither.
Two habits that help:
Hold out by time, never at random. A random split leaks the future into the past: the model sees next Tuesday while predicting last Monday, and reports an accuracy it will never achieve in production. Train on weeks one to eight, validate on nine and ten. The number will be worse. It will also be true.
Plot every important feature's distribution over time before using it. Not the mean, the distribution. Thirty seconds per feature in a notebook, and it surfaces drift, collection bugs and tracking changes that no amount of downstream debugging will find. Half the "mysterious model degradation" I have chased turned out to be a feature whose distribution had quietly shifted because something upstream changed.
#The practice that changed the most
Watching sessions. Not dashboards. Actual session replays, twenty or thirty of them, before touching the model.
Every single time, I have found at least one behaviour the schema could not express. The person who opens six tabs and compares. The person who uses search as navigation because they already know the product name. The person who adds to cart purely to see the delivery estimate.
None of those are visible in an aggregate. All of them change how you weight the events. Thirty sessions is maybe two hours of your life and it is consistently the highest-leverage two hours in the project.
The log tells you what happened. It almost never tells you why. The gap between those two is where every bad model lives.