6 min read

UI Friction Tracking

Learn what rage clicks, dead clicks, and deep scroll reach reveal about broken UX, and pinpoint exact offending CSS selectors with zero session-replay bloat.

Imtiaz Rayhan
Imtiaz RayhanCo-Founder & Lead Engineer, DotCamp & TrimStats
Verified against live TrimStats APIs
Quick reference

How do you enable and configure TrimStats opt-in UI friction tracking?

Enable Track UI friction in Site settings and add data-friction="true" to your 1.96 KB script tag. TrimStats detects rage clicks (3 clicks within 1,000 ms inside 30 px), dead clicks (non-interactive clicks with zero DOM/URL/scroll change for 500 ms), and 90% scroll reach while recording only CSS selector hints.

What rage clicks, dead clicks, and scroll reach reveal

A funnel tells you where visitors drop off, while UI friction signals tell you what broke on the page. Instead of shipping a 50+ KB session-replay recorder that captures DOM text and slows down interaction latency, TrimStats captures three high-signal UX indicators inside the same 1.96 KB gzipped tracker:

  • Rage clicks (broken or sluggish controls): When someone clicks the same spot 3+ times in 1 second, they usually hit a broken button, a disabled checkout control without feedback, or a slow API call with no loading spinner.
  • Dead clicks (false affordances): When visitors click a non-interactive badge, heading, or pricing pill that looks like a button and nothing changes in the DOM or URL, either wire up the interaction or tone down the button-like styling.
  • 90% deep scroll reach (content depth): Measures what percentage of visitors actually scroll near the bottom of the page. Low scroll reach on a landing page signals that your pricing or CTA below the fold is never being seen.
Site analytics / Behavior / UI Friction
Top Friction Elements ranks the exact CSS selector hints (button#annual-toggle, span.plan-quota-badge) causing user frustration alongside each page friction rate.

Enabling UI friction signals

UI friction tracking is opt-in so sites that only want basic traffic metrics incur zero extra event listeners. Enable Track UI friction under Site settings and include data-friction="true" on your script tag:

index.htmlhtml
1<script
2 defer
3 src="https://collect.trimstats.com/t.js"
4 data-site="pk_live_your_key"
5 data-friction="true"
6></script>

Exact detection rules

SignalEvent typeTrigger conditionCaptured target
Rage clickrage_click3 clicks within 1,000 ms inside a 30 px Euclidean radiusCompact CSS selector hint (tag#id or tag.class1.class2, max 120 chars)
Dead clickdead_clickClick on a non-interactive element (not matching a, button, input, select, textarea, label, [role="button"]) followed by zero DOM mutation, zero URL change, and zero scroll change within 500 msCompact CSS selector hint (tag#id or tag.class1.class2)
Deep scroll reachscroll (sc: 90)Fired once per pageview when (window.scrollY + window.innerHeight) / document.documentElement.scrollHeight >= 0.9Current pathname (resets automatically on SPA route changes)
Privacy-safe element hints

TrimStats never captures inner text, input values, or DOM snapshots. Dead-click detection observes only structural/state DOM attributes (class, style, hidden, open, aria-expanded, aria-selected, aria-pressed, data-state) for 500 ms and disconnects the MutationObserver immediately.

Acting on the Friction report

Open Behavior -> UI Friction to see total rage clicks, dead clicks, affected visitors, and overall 90% scroll reach rate. Two ranked tables prioritize fixes:

  • Top friction pages: Ranks up to 25 pathnames by total rage + dead clicks alongside Friction rate (%) (affectedVisitors / totalPageVisitors).
  • Top friction elements: Lists the exact (pathname, elementSelector, eventType) tuples hitting the most users so you can jump straight to the offending CSS selector in your codebase.
  • Automated friction spike alerts: If any page records 15+ friction clicks in a 7-day window and rises by 50%+ over the prior week, TrimStats raises a friction_spike insight automatically.

Common technical questions

Does UI friction tracking capture form inputs, text content, or screen videos?
No. TrimStats never captures DOM snapshots, video recordings, innerText, or form input values. It transmits only compact CSS selector hints (tag#id or tag.class1.class2, max 120 chars) and the active pathname.
When does a UI friction surge trigger an automated anomaly alert?
TrimStats scans friction metrics every 6 hours over rolling 7-day UTC windows and raises a friction_spike insight whenever a page hits at least 15 friction clicks and jumps 50% or more above the prior 7-day baseline.

Related guides