Skip to content

Engagement Scoring

Calculates a 0-100 engagement score for each session based on behavioral signals. Implemented in scoringService.ts. Optimized for real estate websites where most traffic lands on single-page project pages.

Scoring Formula (Real Estate Optimized)

FactorPointsCalculation
Duration0-351 point per 10 seconds, caps at ~6 minutes (350s)
Scroll Depth0-301 point per 3.33% scroll depth, full scroll = 30
Click Count0-201 point per click, caps at 20
Return Visits0-155 points per return session, caps at 3 returns

Total: max 100 points

Why These Factors for Real Estate

  • Duration — A buyer spending 5-10 min reading floor plans and amenities shows strong intent
  • Scroll Depth — Reaching the pricing/contact section at the bottom = high intent
  • Clicks — Gallery photos, floor plan tabs, brochure downloads = active interest
  • Return Visits — Coming back to the same property page = serious buyer
  • No page count — Real estate sites often have a single page per project, making page views meaningless

Engagement Labels

ScoreLabelRecommended Action
0-20ColdBounced or bot — low priority
21-45WarmBrowsed briefly — follow up within 24h
46-70HotRead the page, looked at details — call within 2h
71-100Very HotDeep engagement + return visits — call immediately

Examples

ScenarioDurationScrollClicksReturnsScoreLabel
Bounce (5s, no interaction)00000Cold
Light browse (60s, 50% scroll, 3 clicks)6153024Warm
Engaged visitor (3min, 80% scroll, 10 clicks)182410052Hot
Returning buyer (5min, 100% scroll, 15 clicks, 2 returns)3030151085Very Hot

When Scoring Happens

The engagement score is calculated at session end (/track/session/end) and stored in sessions.engagement_score. When a lead is submitted, the score is recalculated from the active session and stored on the lead record.

Data Sources

  1. Session recordstarted_at / ended_at timestamps for duration
  2. Events aggregategetEventCountsBySession() returns click count and max scroll depth
  3. Fingerprint recordtotal_sessions for return visit count