Skip to main content

Behavioral Research & Feature Roadmap

This document synthesizes findings from academic research and industry studies on web user behavior — cursor kinematics, scroll patterns, form friction, ML frustration scoring, intent signals — and maps them to concrete Datsnip features. It serves as a living reference for product decisions.


Why This Matters​

Standard analytics (pageviews, bounce rate, conversion rate) measure what happened but not why. The research below establishes that behavioral micro-signals — mouse trajectory, hesitation timing, text copy events, back-button timing — reliably predict confusion, frustration, intent, and eventual conversion or abandonment. At scale, these signals can be captured passively with no survey overhead.


Layer 1 — Cursor & Scroll as Cognitive Signals​

Kinematic Trajectory Analysis​

Mouse cursor movement encodes cognitive state. Research on Fitts' Law extensions and kinematic analysis shows that:

  • Spatial deviation (how curved the path is between two points) correlates with decision uncertainty. Straighter paths = confident navigation; curved, wandering paths = confusion about where to click.
  • Angular acceleration variance (jerkiness) predicts cognitive load. High jerk = overloaded working memory.
  • Motor fixation pauses (cursor stops mid-trajectory, not on a target) indicate the user has paused to read or re-orient — a proxy for comprehension difficulty.

Landmark paper: Hauber et al. (2008); Matern et al. (2017) on cursor as surrogate eye-tracking. At 1280×1024, cursor predicts fixation location within 200px radius at ~77% accuracy — sufficient for page-region-level attention mapping without invasive eye tracking hardware.

Practical implication: Wandering cursor trajectories in a checkout flow identify confusion before abandonment occurs. This enables proactive interventions (trigger a tooltip, show a help banner) rather than reactive ones (retargeting after the user left).

Scroll Behavior Patterns​

  • Scroll depth alone is misleading — users frequently scroll to the bottom of a page without reading (F-pattern skimming, diagonal scanning on mobile). Combining scroll depth with dwell time per viewport gives a far more accurate attention signal.
  • Scroll velocity spikes correlate with content skipping. A user who slows dramatically at a specific section is engaging; one who blasts through is not.
  • Scroll reversals (scrolling back up) indicate the user missed something or is cross-referencing information higher on the page — a signal of comprehension difficulty or comparison behavior (positive intent on product pages, negative on checkout/form pages).

Layer 2 — Form Friction & Abandonment Signals​

Field-Level Friction​

Aggregate form completion rates hide the specific friction sources. Field-level data consistently shows:

  • Correction count per field: Users who correct an email field 3+ times are significantly more likely to abandon. Single source of truth: input event count with selectionStart change tracking.
  • Time-to-first-keystroke per field: Long hesitation before the first character = the label is ambiguous or the field is unexpected.
  • Tab-vs-click navigation ratio: Power users tab between fields; confused users click. High click ratio in a form = the user is stopping to re-read each label.
  • Field blur without value + return: Classic pre-abandonment pattern. User focuses field, doesn't fill it, moves cursor toward the browser chrome.

Quantified: Baymard Institute studies consistently show 37% of e-commerce checkout abandonments are caused by form friction that is identifiable at the field level.

Rage Typing​

Less studied than rage-clicking, rage-typing (rapid re-entry into the same field after a validation error) is a strong negative experience signal. Users who rage-type in password fields on login pages are candidates for "forgot password?" proactive prompts.


Layer 3 — ML Frustration Scoring​

Session-Level LSTM Model​

Multiple independent research groups have converged on LSTM (Long Short-Term Memory) architectures for session frustration scoring:

  • Leiva et al. (2012) — "Frustrating the Web" — used desktop interaction logs (mouse speed, clicks, scrolls) to build frustration classifiers.
  • Deeper replication (2024, arxiv 2512.20438) — 91% classification accuracy using only the first 20–30 interaction events of a session. Key features: inter-event timing variance, rage-click count, scroll velocity, dead-click rate, JS error count.

Critical finding: Frustration is predictable early from behavioral patterns, not just detectable retrospectively. This enables real-time triggers ("user is likely frustrated → show help widget") rather than post-hoc analysis.

XGBoost Alternatives​

XGBoost with hand-crafted features (dead-click rate, rage-click rate, form correction rate, scroll reversals, session duration, JS error count) reaches ~90% accuracy with lower infrastructure overhead than LSTM. More interpretable. Preferred for initial implementation.

Features readily available in Datsnip today: rage-click events, dead-click events, JS error events, scroll depth events, form abandon events. A frustration score can be computed in-dashboard from existing ClickHouse data without new SDK instrumentation.


Layer 4 — High-Value Intent Signals​

Text Copy as Purchase/Intent Proxy​

Users who copy text from a page are engaging at a qualitatively different level than passive scrollers:

  • Copying a price = active comparison shopping → high purchase intent
  • Copying a product SKU or address = intent to reference elsewhere → near-conversion
  • Copying an error message = confused or stuck → support candidate
  • Copying a headline or body copy = content research or sharing → content engagement

The copy event (via document.addEventListener('copy', ...)) is trivially cheap to instrument and provides a strong intent signal completely absent from standard analytics stacks.

Back-Bounce Signal​

popstate fired within 5 seconds of pageshow (page becoming visible, not just DOMContentLoaded) = the user landed on the page, immediately pressed back. This is distinct from a normal back-navigation:

  • Fast back-bounce (< 5s): Content mismatch — the page didn't match the user's expectation of where they were going (ad/link copy mismatch, wrong search result)
  • Slow back (> 30s): Normal navigation behavior

The fast back-bounce rate per landing URL is one of the highest-signal quality metrics for ad campaigns and SEO snippets, yet most analytics platforms report it inaccurately because they conflate it with normal back-navigation.

Right-Click as High-Intent Trigger​

contextmenu events on product images, prices, or CTAs indicate:

  • User is trying to open in a new tab (comparison shopping, saving for later)
  • User is inspecting/saving an image (high visual interest)

Right-click rate on a specific element type is a strong predictor of high-intent segments. Using it as a trigger condition ("user right-clicks product image → show save-to-wishlist prompt") converts a passive intent signal into an active one.

Page Visibility / True Attention Time​

document.addEventListener('visibilitychange', ...) distinguishes:

  • Active tab, user present → page is visible
  • Tab in background, user switched → page hidden
  • User returned → visible again

Raw session duration includes all background time. True attention time (sum of all visible intervals) is a far more accurate engagement metric. A user who "spent 10 minutes" but had the tab in the background for 9 of those minutes is not the same as one who spent 10 minutes actively reading.

CLS Misclick Attribution​

Layout Shift (CLS) causes misclicks: the user aims at button A, a late-loading ad or image shifts the layout, and they actually click button B or a blank area. Correlating click event timestamps with PerformanceObserver layout shift entries (within ±200ms) identifies which layout shifts are causing usability problems — completely independent of Lighthouse's CLS score, which doesn't track actual user impact.

Error Clicks (Non-Interactive Elements)​

Clicks on elements with no click handler, no href, no role="button" — outside any interactive control — are design confusion signals. A user clicking a visual element they assumed was interactive is discovering a design gap. Aggregated across sessions, these form a confusion heatmap that is more actionable than a traditional click heatmap because it specifically marks unexpected interactions.


Prioritized Feature Build Order​

PriorityFeatureSDK instrumentation neededClickHouse workComplexity
1Session Frustration ScoreNone — derive from existing eventsNew query + score columnLow
2Hover-to-Click Rate per elementNone — already have hover_hesitation + clicksNew aggregationLow
3Field-Level Form Friction MapExtend form_abandon module (correction count, timing)New table + queryLow–Medium
4True Attention Time (Page Visibility)New visibility_change event typeTrivialVery low
5Text Copy Intent SignalNew text_copy event typeTrivialVery low
6Back-Bounce SignalNew back_bounce event typeNew queryLow
7Error Click DetectionNew error_click event typeNew heatmap queryLow
8Right-Click Trigger ConditionAdd contextmenu to trigger event typesNoneLow
9CLS Misclick AttributionCorrelate existing clicks with PerformanceObserverMedium join queryMedium
10Friction-Adjusted FunnelDepends on #1 (frustration score per session)Funnel + score joinMedium
11Confusion Heatmap (cursor trajectory)New trajectory sampling (sampled mousemove)Aggregation pipelineHigh
12Multi-Signal Exit IntentAggregate #1, #4, #6ML model or rule engineMedium–High

Items 4 and 5 (Page Visibility and Text Copy) have the best effort-to-signal ratio — each is ~10 lines of SDK code and zero schema changes, and both fill gaps in every competitor's analytics offering.

Items 1–3 are executable entirely in ClickHouse against data already being collected.


Academic References​

SourceKey finding
Matern et al. (2017) — Mouse Cursor as Surrogate for Eye Tracking77% accuracy predicting fixation location from cursor position at 1280px
Hauber et al. (2008) — Kinematic Analysis of Mouse TrajectoriesTrajectory curvature encodes decision uncertainty; angular acceleration encodes cognitive load
Leiva et al. (2012) — Frustrating the WebBehavioral signals (mouse speed, clicks, scrolls) train frustration classifiers with >80% accuracy
arxiv 2512.20438 (2024) — Session Frustration PredictionLSTM reaches 91% accuracy from first 20–30 interaction events; early prediction enables real-time intervention
Baymard Institute (ongoing) — E-commerce UX research37% of checkout abandonments attributable to field-level form friction; field-level analysis required
Atterer et al. (2006) — Knowing the User's Every MoveFirst large-scale cursor tracking study establishing cursor-attention correlation on real websites
Google Web Vitals — Cumulative Layout ShiftCLS defined; note: CLS score does not track user-impact of shifts — requires correlating with click events

Implementation Notes​

When adding new SDK event types (items 4–8 above):

  1. Add the event type to sdk/src/modules/ as a new module (see existing modules for pattern)
  2. Add the type string to the event schema in backend/internal/ingest/
  3. Add a ClickHouse migration for any new aggregate tables
  4. Wire the module in sdk/src/index.ts under config.modulesEnabled

Trajectory sampling (item 11) requires care: mousemove fires at 60Hz. Sampling at 1 in 10 events with performance.now() timestamps is sufficient for trajectory analysis and keeps the event volume manageable. Never send raw mousemove events — that would 60× the event volume.