Simulation
Friction detector
Rage clicks, dead clicks, scroll thrash, and a stalled field on a demo widget. The page says which rule intervened.
Understanding the labHow to use it and why you'd want to
Why you'd want to
Rage clicks, dead clicks, scroll thrash, and a stalled field are rules on a demo widget. The log stays in this tab, and after Accept the page queues lab_interaction rather than the log.
How to use it
- Three clicks in a short burst count as rage.
- A click that hits nothing is a dead click.
- Direction changes count as thrash. A focused field can stall.
- After Accept, the lab event is queued, not the log lines.
Simulation. Rules on this demo widget only. Nothing is stored or sent. No model call.
Demo widget
Find the friction
Learn more is a dead control in this demo. It records the click and does not open a page.
0 Continue clicks in the last second. Three opens the simpler version.
Field not focused.
Scroll this box up and down. Three direction changes count as thrash. This text is only here to make the box scroll.
Bottom of the sample.
No friction yet.
Why am I seeing this? Rage is three clicks on Continue inside one second. A dead click is the control that does not navigate. Thrash is three direction changes in the sample scroller. A field stalls after three seconds of focus with no typing. The characters you type are not kept.
Log
Why the page changed
The log is empty.
Why am I seeing this? Each row is one rule that fired on this widget. The log stays in memory for this view and is cleared with the page.
WalkthroughHow we built itShowHide
Example vendor setup is marked below. eVar and event numbers are examples. This lab does not call Adobe.
The friction detector applies rage, dead-click, thrash, and stall rules on a demo widget, keeps the log in the tab, and queues lab_interaction after Accept. The lab does not call Adobe.
Count three clicks
noteClick on Continue keeps timestamps inside one second. Three or more calls push rage and the intervention simpler. A dead target pushes dead and help immediately.
Count direction changes
noteScroll increments flips when the direction changes. Three flips push thrash and shortcut. The scroller in the widget is the only element that calls it.
Stall a focused field
noteFocus stores the time and clears typed. noteType sets typed. noteTick pushes stalled and help after three seconds of focus with no typing, and only once.
Queue the lab event, not the log
useLabView queues lab_interaction with action view. A new log entry calls trackLab with the kind as label and action run_demo. The characters in the field are not kept, and the friction log is not a parameter.
From the code
Rage is three clicks in one second. Thrash is three direction changes.
export function noteClick(state: FrictionState, target: "submit" | "dead", now: number): FrictionState {
if (target === "dead") return push(state, "dead", "help")
const recent = [...state.recent.filter((at) => now - at <= RAGE_WINDOW_MS), now].slice(-8)
const next = { ...state, recent }
if (recent.length >= RAGE_CLICKS) return push(next, "rage", "simpler")
return next
}
export function noteScroll(state: FrictionState, dir: -1 | 1): FrictionState {
if (state.lastDir !== 0 && dir !== state.lastDir) {
const flips = state.flips + 1
const next = { ...state, flips, lastDir: dir }
if (flips >= THRASH_FLIPS) return push(next, "thrash", "shortcut")
return next
}
return { ...state, lastDir: dir }
}A stall needs focus, no typing, and three seconds. It is logged once.
export function noteTick(state: FrictionState, now: number): FrictionState {
if (state.focusedAt === null || state.typed) return state
if (now - state.focusedAt < STALL_MS) return state
if (state.log.some((entry) => entry.kind === "stalled")) return state
return push(state, "stalled", "help")
}Google and Adobe
Google queues lab_interaction after Accept. Adobe is an example of the same fields.
Queued only after Accept. The view push is lab_interaction with lab_id friction-detector, action view, and label page. A detected kind queues the same event with action run_demo and label rage, dead, thrash, or stalled. The intervention and the typed text are not parameters. This site does not call Adobe.
Simplified shape of the object queued after Accept. Register any new parameter as an event-scoped custom dimension. This site does not call gtag('set').
dataLayer.push({
event: "lab_interaction",
lab_id: "friction-detector",
action: "view",
label: "page",
})Example implementation. This site does not call Adobe. eVar73, prop73, and event73 are example variable numbers. In Launch, a data element reads the value and a rule sends it when the value changes. In the report suite, enable eVar73 with Most Recent allocation and expire it on the hit. A processing rule is unnecessary if the data element maps straight to that eVar.
Example alloy payload. _example is a placeholder schema, not a real tenant.
alloy("sendEvent", {
xdm: {
eventType: "web.webinteraction.linkClicks",
_example: {
frictionKind: "rage",
},
},
})Example hit. eVar73 is hit-scoped in this example. prop73 dies at the same hit.
s.eVar73 = "rage"
s.prop73 = "rage"
s.events = "event73"
s.linkTrackVars = "eVar73,prop73,events"
s.linkTrackEvents = "event73"
s.tl(true, "o", "lab_interaction")Translation
Each lab field, the GA4 name, and the example Adobe variable. Scope is the part that usually gets lost in the translation.
Lab id
GA4. Parameter lab_id on lab_interaction. The value is friction-detector.
Adobe. Example eVar73, expire on the hit.
Scope. Event on the hit. It names the page, not a user, and it does not cover the visit.
Action
GA4. Parameter action. view on load, run_demo when a rule fires.
Adobe. Example prop73, which dies at the hit.
Scope. Event. Do not store the action as a user property for the visit. It is an event on the hit, not a user property, and it does not last for the visit.
Kind
GA4. Parameter label on the run_demo push: rage, dead, thrash, or stalled. The view uses label page.
Adobe. Example eVar73 if you mapped the kind. It is still an example.
Scope. Event on the hit. The kind is not a user property and it does not last for the visit.
Typed text
GA4. Not sent. noteType only sets a boolean.
Adobe. Example prop73 must not hold the text. Not sent.
Scope. Not an event, not a user property, and not a hit or visit field.
Recommended next
Why these picksReading path transitions…