Engineering • Behavioral Model Series
Part 2 of 10

Value Scoring and Anomaly Detection

How ClickStream predicts visitor monetary value and identifies behavioral outliers in real time -- from high-value whale detection to bot filtering and fraud prevention.

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

In the Intelligence tab, Value Estimator and Anomaly Detection scores appear as real-time cards. The Value score helps you prioritize high-value visitors; the Anomaly score flags unusual behavior for investigation. Click any card for trend charts and contributing signals.

Business Actions: Set up alerts when Value > 80 to notify sales teams of high-value visitors. Configure Anomaly > 70 alerts to flag potential bot traffic or suspicious behavior for review in the Signals tab.

Model 4: Value Estimator

The value estimator predicts the monetary value a visitor is likely to generate, either in the current session or over their customer lifetime. This score drives prioritization: when support resources are limited, you want to focus on your highest-value visitors.

Value Signal Weights

SignalWeightDescription
Cart value / plan tier viewed0.25Direct monetary signal: items in cart or pricing tier being evaluated
Intent score0.20Higher intent = higher expected value (cross-model dependency)
Historical visitor value0.15Past purchase amount for returning visitors
Engagement depth0.12Deep engagement with high-value content (product specs, pricing)
Referral source quality0.10Visitors from high-converting channels score higher
Session page count0.08More pages = more consideration = higher potential value
Device and geo signals0.06Desktop users and certain geos correlate with higher AOV
Time-of-day pattern0.04Business hours vs. off-hours browsing correlates with purchase intent

E-Commerce Scoring Formula

For e-commerce sites, the value estimator uses a weighted combination that emphasizes direct monetary signals:

TypeScript
function estimateEcommerceValue(features: BehavioralFeatures, context: SessionContext): number { // Direct value signals const cartSignal = Math.min(features.cartValue / siteAvgOrderValue, 2.0) * 25; const intentSignal = features.intentScore * 0.20; // Historical value (returning visitors only) const historySignal = context.isReturning ? Math.min(context.historicalLTV / siteAvgLTV, 3.0) * 15 : 7.5; // neutral for new visitors // Engagement and behavior signals const engagementSignal = features.engagementScore * 0.12; const referralSignal = channelValueMultiplier[context.referrerCategory] * 10; const depthSignal = Math.min(features.pageViewCount / 8, 1) * 8; const deviceGeoSignal = (context.deviceType === 'desktop' ? 4 : 2) + geoValueMultiplier[context.geoRegion] * 2; const timeSignal = isBusinessHours(context.localHour) ? 4 : 2; return Math.min(100, Math.round( cartSignal + intentSignal + historySignal + engagementSignal + referralSignal + depthSignal + deviceGeoSignal + timeSignal )); }

SaaS Scoring Formula

For SaaS products, the formula shifts emphasis from cart value to plan tier evaluation and feature exploration:

TypeScript
function estimateSaaSValue(features: BehavioralFeatures, context: SessionContext): number { // Plan tier signal: which pricing tier is the user evaluating? const tierSignal = planTierValue[features.highestPlanViewed] * 25; // e.g., { free: 0.1, starter: 0.3, professional: 0.6, enterprise: 1.0 } // Feature exploration: users who explore more features = higher potential const featureExploration = Math.min(features.uniqueFeaturesViewed / 10, 1) * 15; // Trial engagement (if applicable) const trialSignal = features.trialActionsCompleted ? Math.min(features.trialActionsCompleted / 5, 1) * 20 : features.intentScore * 0.15; // Company signals (if identifiable from IP/domain) const companySignal = context.companySize ? companySizeMultiplier[context.companySize] * 12 : 6; return Math.min(100, Math.round( tierSignal + featureExploration + trialSignal + companySignal + features.engagementScore * 0.10 + (context.isReturning ? 8 : 3) )); }

Value × Frustration Alert

One of the most actionable combinations in the entire scoring system: a high-value visitor experiencing high frustration. This triggers an immediate alert because the revenue at risk is significant.

TypeScript
function checkValueFrustrationAlert(scores: BehavioralScores): Alert | null { if (scores.valueEstimate >= 70 && scores.frustrationScore >= 50) { return { type: 'high_value_frustration', severity: 'critical', message: `High-value visitor (${scores.valueEstimate}) frustrated (${scores.frustrationScore})`, recommendedAction: 'proactive_chat', estimatedRevenue: dollarValueFromScore(scores.valueEstimate) }; } return null; }

Model 5: Anomaly Detection

The anomaly score identifies behavioral patterns that deviate significantly from established baselines. This serves dual purposes: detecting bots and fraud, and identifying genuinely unusual (but human) behaviors that may require attention.

Dual Baseline Comparison

Every behavioral feature is compared against two baselines simultaneously:

  1. Site baseline: The aggregate behavioral distribution across all visitors to this site. This catches behavior that is unusual for your site specifically.
  2. Visitor baseline: The individual visitor's historical behavior (for returning visitors). This catches behavior that is unusual for this particular user.

The anomaly score is the maximum of the two z-scores, normalized to 0–100:

Formula
anomalyScore = sigmoid(max( |feature - siteMean| / siteStdDev, |feature - visitorMean| / visitorStdDev )) * 100

Anomaly Types

Anomaly TypeDetection SignalTypical CauseAction
Speed anomalyEvent rate > 3σ above site meanBot, automated testing, or power userBot check or whitelist
Pattern anomalyNavigation sequence rarely seen in site dataScraper, vulnerability scanner, or lost userCAPTCHA or redirect
Temporal anomalyActivity at unusual hours for visitor's timezoneAccount sharing, bot, or international travelSoft verification
Interaction anomalyMouse/scroll patterns outside human normsHeadless browser, automation toolChallenge page
Volume anomalyPage views > 3σ in session durationScraper or extremely engaged researcherRate limit or monitor
Behavioral shiftReturning visitor with drastically different patternsAccount compromise, new user on shared deviceIdentity verification

Bot Detection Integration

The anomaly model feeds into a dedicated bot detection formula that combines multiple anomaly signals with known bot signatures:

Formula
botProbability = w1 * speedAnomaly + w2 * interactionAnomaly + w3 * patternAnomaly + w4 * (1 - mouseEntropy) + w5 * (1 - scrollVariance) + w6 * headerSignature Where: w1 = 0.20 // Speed is strong signal w2 = 0.25 // Mouse/interaction pattern is strongest w3 = 0.15 // Navigation pattern w4 = 0.15 // Low entropy = robotic movement w5 = 0.10 // Consistent scroll speed = automated w6 = 0.15 // Known bot UA strings, missing headers

False Positive Mitigation

Anomaly detection is only useful if the false positive rate is low enough for automated action. ClickStream uses several strategies to minimize false positives:

Value × Anomaly Interplay Matrix

The combination of value and anomaly scores creates a prioritization framework for security and customer success teams:

Low Anomaly (0–30)Medium Anomaly (31–60)High Anomaly (61–100)
Low Value (0–30)Normal traffic. No action needed.Monitor. Likely bot or scanner.Block or challenge. Probable bot.
Medium Value (31–60)Standard visitor. Nurture normally.Investigate. Could be sophisticated scraper or unusual human.Challenge carefully. May be power user.
High Value (61–100)VIP visitor. White-glove treatment.Soft verify. Too valuable to block incorrectly.High priority investigation. Could be fraud or account compromise.

The cardinal rule of value-anomaly interplay: never auto-block a high-value session. The cost of a false positive on a whale customer far exceeds the cost of letting a sophisticated bot through. Use soft challenges (invisible CAPTCHAs, behavioral verification) for high-value anomalies.

Storage Schema

Value and anomaly events are stored with full context for post-hoc analysis and model calibration:

SQL
CREATE TABLE clickstream_value_anomaly_events ( visitor_id STRING NOT NULL, session_id STRING NOT NULL, event_timestamp TIMESTAMP NOT NULL, -- Value fields value_score FLOAT64, value_tier STRING, -- 'low', 'medium', 'high', 'whale' estimated_revenue FLOAT64, -- Anomaly fields anomaly_score FLOAT64, anomaly_type STRING, -- 'speed', 'pattern', 'temporal', etc. bot_probability FLOAT64, anomaly_features JSON, -- which features triggered the anomaly -- Alert metadata alert_fired BOOLEAN, alert_type STRING, action_taken STRING ) PARTITION BY DATE(event_timestamp) CLUSTER BY visitor_id;
Previous in Series ← Part 1: Intent, Frustration & Engagement

Spot Your Highest-Value Buyers and Block the Bots

Prioritize your best prospects with real-time value scoring while eliminating the ad fraud that inflates your metrics and wastes your budget.

GET EARLY ACCESS