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 displays optimal send windows for each visitor based on their historical conversion patterns.

Business Actions: Set up a Rule to fire an exit-intent overlay when Abandonment Detection exceeds 80. Use Purchase Timing scores to schedule retargeting emails at the exact hour each visitor is most likely to convert. 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 8 Abandonment Signals

SignalWeightDetection Method
Mouse drift to browser chrome0.20Cursor moving toward close/back buttons or address bar
Idle timeout0.18No interaction for 30+ seconds on an active page (cart, form)
Tab switch away0.15Page visibility hidden while in a conversion flow
Scroll to top on cart/checkout0.12Scrolling back to top of checkout page (looking to navigate away)
Form abandonment cues0.10Stopping mid-form after completing 30%+ of fields
Price shock indicators0.08Viewing total/shipping cost then pausing >10 seconds
Back button readiness0.09Browser back button hover or keyboard shortcut preparation
Engagement collapse0.08Sharp drop in mouse movement and interaction rate

The 4 Abandonment Stages

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. It uses a composite formula that accounts for velocity, trajectory, and context:

TypeScript
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; return Math.min(100, Math.max(0, rawScore)); }

Timing Pipeline Latency Breakdown

For abandonment detection to work, the entire pipeline from signal detection to intervention display must complete before the user leaves. Here is the latency budget:

Pipeline Stagep50 Latencyp99 LatencyBudget
Browser event capture1ms3ms5ms
SDK signal processing2ms8ms10ms
Edge worker scoring5ms18ms25ms
Intervention decision1ms3ms5ms
Response to browser3ms15ms20ms
DOM manipulation (show overlay)4ms12ms15ms
Total16ms59ms80ms

The 80ms total budget is critical. Research shows that exit intent users take 200–400ms from "decision to leave" to "browser close." Our pipeline must complete well within that window to display an intervention.

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

SignalWeightDescription
Funnel stage progression0.22How far through the conversion funnel (browse → product → cart → checkout)
Decision confidence velocity0.18Rate of change in decision confidence score (rising = closer)
Cart completeness0.15Percentage of typical pre-purchase actions completed
Comparison narrowing0.12Convergence of product consideration set
Payment readiness signals0.10Scrolling to payment section, clicking payment method selector
Time pressure indicators0.08Visiting sale pages, countdown timers, limited stock messages
Visit frequency acceleration0.08Increasing visit frequency = decision approaching
Social proof consumption0.07Reading reviews then stopping (final validation before purchase)

Proximity Score Ranges

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

ClickStream classifies the type of urgency driving the purchase timing, which informs what kind of messaging is appropriate:

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
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:

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

GET EARLY ACCESS