Engineering • Behavioral Model Series
Part 6 of 10

Abandonment Detection and Purchase Timing

How ClickStream detects abandonment across carts, forms, and pages in real time -- and predicts exactly how close a user is to making a purchase, enabling perfectly timed interventions.

March 2026

Introduction Part 1: Intent, Frustration & Engagement Part 2: Value & Anomaly Part 3: Confusion & Emotion Part 4: Decision & Regret Part 5: Churn & LTV Part 6: Abandonment & Timing Part 7: Affinity, Friction & Next Action Part 8: Momentum, Entropy & Attention Part 9: Conversion, Hover & Scroll Part 10: Price, Loyalty, Micro-Conversion & Bot Detection

What You'll See in the Dashboard

Open the Intelligence tab to find the Abandonment Detection and Purchase Timing cards. Abandonment shows a real-time probability that the current visitor is about to leave without converting — watch it spike as exit signals accumulate. Purchase Timing shows how close each visitor is to converting, with an urgency classification to guide your outreach.

Business Actions: Set up a Rule to fire an exit-intent overlay when Abandonment Detection exceeds 80. Use Purchase Timing scores to time retargeting and lifecycle sends in your ESP. Feed abandonment signals into your cart-recovery automation.

Model 12: Abandonment Detection

The abandonment model detects when a user is about to leave without completing their intended action -- whether that is a cart checkout, a form submission, or simply engaging with content. Unlike post-hoc abandonment analysis, ClickStream detects abandonment signals in real time, giving you a window to intervene.

The 7 Abandonment Signals

The signals below illustrate what the model watches; how each is weighted is tunable per site.

SignalDetection Method
Mouse drift to browser chromeCursor moving toward close/back buttons or address bar
Idle timeoutNo interaction for 30+ seconds on an active page (cart, form)
Tab switch awayPage visibility hidden while in a conversion flow
Scroll to top on cart/checkoutScrolling back to top of checkout page (looking to navigate away)
Form abandonment cuesStopping mid-form after completing 30%+ of fields
Price shock indicatorsViewing total/shipping cost then pausing >10 seconds
Engagement collapseSharp drop in mouse movement and interaction rate

The 4 Abandonment Stages

The model emits a stage alongside the score. The stage names, score bands, and intervention windows below are our operating framework for reading that output:

Score RangeStageUser StateIntervention Window
0–25EngagedActively interacting. No abandonment signals.N/A -- user is engaged.
26–50WaveringSlowing down, some hesitation signals.15–30 seconds. Soft nudge opportunity.
51–75DisengagingClear disengagement pattern. Preparing to leave.5–15 seconds. Immediate intervention needed.
76–100ExitingActive exit behavior. Mouse at browser chrome.1–5 seconds. Last-chance intervention only.

Exit Intent Formula

ClickStream's exit intent detection goes beyond simple "mouse near top of viewport" heuristics. Conceptually, it combines velocity, trajectory, and context into a composite score — shown here in simplified, illustrative form:

TypeScript (illustrative)
function calculateExitIntent(mouseEvents: MouseEvent[], context: PageContext): number { const recent = mouseEvents.slice(-10); // last 10 mouse positions if (recent.length < 3) return 0; // Calculate upward velocity (toward browser chrome) const yVelocity = (recent[0].y - recent[recent.length - 1].y) / (recent[recent.length - 1].timestamp - recent[0].timestamp); // Position factor: how close to viewport top const positionFactor = Math.max(0, 1 - recent[recent.length - 1].y / 100); // Trajectory: is cursor heading toward close/back buttons? const trajectory = calculateTrajectoryToTarget(recent, context.closeButtonPos); // Context factor: higher weight if user has items in cart const contextWeight = context.hasCartItems ? 1.5 : 1.0; const rawScore = ( yVelocity * 0.35 + positionFactor * 0.30 + trajectory * 0.35 ) * contextWeight; // rawScore is a 0–1 composite; scale to the 0–100 score range return Math.min(100, Math.max(0, rawScore * 100)); }

Timing Pipeline Latency

Two latency numbers govern this pipeline. The behavioral scoring pass inside the collector holds a CI-enforced p95 under 3 ms per event, and the documented Signals read round trip is roughly 50–150 ms. Because an exit decision plays out in a few hundred milliseconds, exit-intent interventions are driven client-side by the SDK using the most recent scores, with edge scores refreshing between interactions rather than inside the exit window.

Model 13: Purchase Timing

The purchase timing model predicts how close a user is to making a purchase decision. Unlike the intent score (which measures willingness), purchase timing measures proximity -- how many more interactions until the purchase event occurs.

The 8 Timing Signals

As with abandonment, the signals below illustrate what the model watches; how each is weighted is tunable per site.

SignalDescription
Funnel stage progressionHow far through the conversion funnel (browse → product → cart → checkout)
Decision confidence velocityRate of change in decision confidence score (rising = closer)
Cart completenessPercentage of typical pre-purchase actions completed
Comparison narrowingConvergence of product consideration set
Payment readiness signalsScrolling to payment section, clicking payment method selector
Time pressure indicatorsVisiting sale pages, countdown timers, limited stock messages
Visit frequency accelerationIncreasing visit frequency = decision approaching
Social proof consumptionReading reviews then stopping (final validation before purchase)

Proximity Score Ranges

The bands below are an operating framework for reading the model's conversion-proximity output:

Score RangeProximityEstimated Time to PurchaseOptimal Action
0–20DistantMultiple sessions awayContent marketing, brand building
21–40Approaching1–3 sessions awayRetargeting, email nurture
41–60NearThis session, but more exploration neededSocial proof, comparison tools
61–80ImminentWithin the next few minutesRemove friction, ensure smooth checkout
81–100Ready nowWithin secondsClear CTA, one-click purchase if possible

Urgency Classification

The timing model outputs an urgency classification alongside proximity. The four urgency types below are our operating framework for matching messaging to that output:

Urgency TypeDetection SignalsMessaging Strategy
Time-limitedSale page views, countdown timer interaction, promo code entryReinforce deadline, show remaining time
Need-drivenUrgent search terms, fast navigation, minimal comparisonEmphasize immediate availability and fast delivery
Research-completeLong research phase now converging, reviews consumedConfidence reinforcement, satisfaction guarantee
Externally triggeredReferrer from price-alert email, social recommendationValidate the referral source, show deal details

Visit Frequency Acceleration

One of the strongest cross-session timing signals is increasing visit frequency. A user who visited once a week for three weeks, then twice in three days, is approaching a decision:

TypeScript (illustrative)
function visitFrequencyAcceleration(sessions: SessionTimestamp[]): number { if (sessions.length < 3) return 0; // Calculate intervals between sessions const intervals = []; for (let i = 1; i < sessions.length; i++) { intervals.push(sessions[i] - sessions[i - 1]); } // Calculate acceleration (change in interval) const accelerations = []; for (let i = 1; i < intervals.length; i++) { accelerations.push(intervals[i - 1] - intervals[i]); } // Positive acceleration = intervals getting shorter = more frequent const avgAcceleration = accelerations.reduce((a, b) => a + b, 0) / accelerations.length; return sigmoid(avgAcceleration / 86400000); // normalize by 1 day in ms }

Abandonment × Purchase Timing Intervention Matrix

Low Timing (0–30)Medium Timing (31–60)High Timing (61–100)
Low Abandonment (0–30)Let browse. Content engagement.Encourage. Show related products.Clear the path. Minimize distraction.
Med. Abandonment (31–60)Soft re-engage. Newsletter signup.Show urgency cue. Limited stock.Highlight benefits. Address hesitation.
High Abandonment (61–100)Save for later. Email capture.Incentive offer. Free shipping.CRITICAL: maximum-impact intervention.

Form-Specific Abandonment Analysis

For forms, ClickStream tracks field-level abandonment to identify exactly where users drop off. Field-level rollups appear in the dashboard; conceptually, the aggregation looks like this (illustrative — ClickStream persists scores to Analytics Engine, not a customer-queryable SQL table):

SQL (illustrative)
SELECT form_id, field_name, COUNT(*) AS abandonment_count, AVG(time_spent_on_field_ms) AS avg_time_on_field, AVG(fields_completed_before_abandon) AS avg_fields_completed, SUM(CASE WHEN had_error THEN 1 ELSE 0 END) AS error_count, ROUND(COUNT(*) * 100.0 / total_form_starts, 1) AS abandonment_rate_pct FROM clickstream_form_abandonment WHERE event_date >= CURRENT_DATE - INTERVAL 7 DAY GROUP BY form_id, field_name, total_form_starts ORDER BY abandonment_count DESC LIMIT 20;
Previous in Series ← Part 5: Churn & LTV Prediction

Catch Buyers at the Exact Moment They Are Ready to Convert

Detect abandonment before it happens and trigger the right intervention at the right second. Every recovered cart is revenue that would have walked away.

Start free