SDK Configuration
Auto capture is off by default. Auto capture behavior is configured through theconfig options passed to Userpilot.initialize.
When either
enableScreenAutoCapture or enableInteractionAutoCapture is enabled, the DOM auto capture engine starts automatically after initialize.
Screen Capture
WhenenableScreenAutoCapture is true, the engine reports a screen whenever the route changes. The screen name is location.pathname + location.search, sent as-is β including the root path / β for example /post-details?id=10. Consecutive identical names are de-duplicated.
Interaction Capture
WhenenableInteractionAutoCapture is true, the engine captures the following DOM interactions through a small set of delegated, capture-phase listeners on document:
Each interaction maps to a high-level analytics category (
tap, text_change, selection_change, value_change, view_presented) β that is the event name that reaches your analytics backend.
Component Value Gating
By default, user-input values are stripped from event payloads βis_checked, selected dates and times, slider/range values, and dropdown selections do not leave the device. To include them, pass enableInteractionValueCapture: true in config. Position fields such as selected_index are always captured because they donβt reveal user input; selected_value is only included when value capture is enabled. Per-element overrides have higher priority.
Privacy Controls
Global flags govern what is captured:- Text capture β
enableInteractionTextCapture - Accessibility label capture β
enableInteractionAccessibilityLabelCapture - Value payload capture β
enableInteractionValueCapture
****; when no text exists, the property is omitted. Redaction is scoped to target_text (and the dialog_title of a presented surface). It does not mask accessibility_label or the hierarchyβs attr__desc β accessibility labels are developer-authored, so they are controlled only by enableInteractionAccessibilityLabelCapture.
Event Metadata Keys
Common fields on interaction events:UserpilotRedactText
Redaction replaces the captured target_text (and the dialog_title of a presented surface) with ****. The interaction event still fires β the element is still identified by type, position, and structure β only the human-readable text is masked. Accessibility labels are not masked by redaction; they are controlled only by enableInteractionAccessibilityLabelCapture.
The programmatic API accepts either an Element or a CSS selector and applies to the element and its subtree:
UserpilotIgnoreInteractions
Ignoring skips interaction events whose hit-tested element lies inside the subtree (taps, value changes, text-field updates, etc.). Route-driven screen events are not suppressed β they come from route detection, not from element hit testing. The host appβs own handlers still run β only auto capture ignores those interactions.
The programmatic API accepts either an Element or a CSS selector and applies to the element and its subtree:
Runtime Controls
Auto capture starts automatically frominitialize (based on config). To stop or resume collection at runtime without re-passing the config β for example a βprivate modeβ β use:
screen() calls: when enableScreenAutoCapture is configured, manual and automatic screen tracking remain mutually exclusive, including while auto capture is stopped.