Prompt
How do I see scroll depth and hesitation inside a web app?
Latest observation
Oct 23, 2026
OpenAI APIWeb search: off
To see scroll depth and hesitation inside a web app, you usually instrument user behavior in the frontend and send events to an analytics tool or your own backend.
1) Scroll depth
Track how far a user gets down a page.
Common ways
- Percentage reached: 25%, 50%, 75%, 100%
- Pixels scrolled
- Section-based: user reached specific components/cards/modules
Basic approach
Listen to the scroll event and compute:
const depth = (window.scrollY + window.innerHeight) / document.documentElement.scrollHeight * 100;
Then fire events only when thresholds are crossed, e.g.:
scroll_depth_25scroll_depth_50scroll_depth_75scroll_depth_100
Better practice
- Use
IntersectionObserverfor specific page sections - Throttle/debounce scroll tracking to avoid performance issues
2) Hesitation
“Hesitation” usually means the user paused before acting or seemed unsure.
Common signals
- Mouse dwell time: pointer sits over an element without clicking
- Time to click: time between page load and first interaction
- Input pause: long pause while filling a form
- Repeated focus/blur on the same field
- Back-and-forth movement between elements
- Hover without action on buttons/links
- Rage clicks or repeated clicks
Examples
- User hovers over “Buy now” for 4 seconds before clicking
- User focuses a form field, leaves, comes back, leaves again
- User spends 20 seconds on a checkout step without progressing
Basic implementation idea
Track timestamps for:
- page load
- hover start/end
- focus/blur
- click
Then compute durations:
hesitation_before_click = click_time - hover_or_view_timeform_field_pause = blur_time - focus_time
3) Tools that do this for you
If you don’t want to build it manually:
- PostHog
- FullStory
- Hotjar
- Microsoft Clarity
- Amplitude / Mixpanel with custom events
These can show:
- scroll maps
- session replays
- heatmaps
- rage clicks
- dead clicks
- form analytics
4) Practical recommendation
If you want both metrics reliably:
- Add scroll tracking at key thresholds
- Track element visibility with
IntersectionObserver - Log focus/blur/hover/click events
- Define “hesitation” based on time thresholds, e.g.:
- hover > 2s
- form pause > 5s
- no interaction for > 10s after section becomes visible
5) Important caveats
- Don’t over-collect sensitive data
- Avoid recording typed values unless necessary
- Be transparent in your privacy policy
- Respect consent requirements like GDPR/CCPA
If you want, I can give you:
- a plain JavaScript snippet
- a React example
- or a PostHog/GA4 setup for scroll depth and hesitation tracking.