Skip to main content
Configure automatic screen and interaction capture for Ionic Capacitor applications using the Userpilot Capacitor plugin. The Userpilot Capacitor plugin can automatically capture screens and interactions in your Ionic app and forward them to the native Userpilot SDKs, enabling analytics and engagement without manual screen and event tracking. Because Ionic renders inside a single native WebView, auto capture runs entirely in the DOM at runtime β€” there is no build-time instrumentation to configure. The engine detects route changes and interactions and bridges them to the native SDK, so the resulting events are indistinguishable from native auto capture on the backend.

SDK Configuration

Auto capture is off by default. Auto capture behavior is configured through the config options passed to Userpilot.initialize.
When either enableScreenAutoCapture or enableInteractionAutoCapture is enabled, the DOM auto capture engine starts automatically after initialize.
NoteAuto Capture automatically tracks screen views and ignores manually sent screen events while enabled.If you are migrating from manual screen tracking, please review the migration guide here.

Screen Capture

When enableScreenAutoCapture 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.
Manual screensManual screen() calls are ignored whenever enableScreenAutoCapture is configured β€” manual and automatic screen tracking remain mutually exclusive, including while auto capture is stopped. To send screens manually, leave enableScreenAutoCapture: false.

Interaction Capture

When enableInteractionAutoCapture 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
Disabling text capture removes text-derived properties from the payload. Redaction replaces an existing text/title with ****; 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:
A declarative HTML attribute is also supported:

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:
A declarative HTML attribute is also supported:

Runtime Controls

Auto capture starts automatically from initialize (based on config). To stop or resume collection at runtime without re-passing the config β€” for example a β€œprivate mode” β€” use:
While stopped, no screen or interaction events are recorded regardless of other configuration. Pausing auto capture does not enable manual screen() calls: when enableScreenAutoCapture is configured, manual and automatic screen tracking remain mutually exclusive, including while auto capture is stopped.