Auto-capture

Events captured automatically: page views, clicks, forms, errors, performance, and Web3.

With auto-events enabled, the browser SDK captures a behavioral baseline with no per-event code. Add custom events on top for business-specific actions.

What's captured

EventFires when
page_viewPage load, plus SPA route and hash changes
element_clickAny click, with element and coordinate context
rage_click3+ clicks on the same element in 1s (frustration)
dead_clickClick on a non-interactive element with no navigation
page_scrollA new maximum scroll depth is reached
text_selection3+ characters selected
element_viewAn element with an id is 50%+ visible for 1s
form_submitAn HTML form is submitted (field values never captured)
form_validation_errorA field fails native validation
form_abandonedThe page unloads with a touched, unsubmitted form
media_play / media_pauseA <video> or <audio> plays or pauses
js_errorAn uncaught error or unhandled promise rejection
network_errorAn SDK request to Trodo fails or returns 4xx/5xx
page_performanceCore Web Vitals (LCP, CLS, INP, FCP, TTFB) after load

Form field values are never captured, to protect sensitive data.

Web3 and wallets

On Web3 sites the SDK also auto-detects the visitor's wallet and chain non-intrusively (30+ EVM wallets, 40+ chains) without prompting them to connect, and tracks account and chain changes in real time. These land as session properties: wallet_type, chain_name, wallet_connected, and is_web3_user.

Event envelope

Every event, auto or custom, is stamped with context automatically:

GroupProperties
Sessionsession_id, user_id, distinct_id
Pagepage_url, page_title, page_path, referrer
Devicebrowser_name, browser_version, os, device_type, resolution, language, user_agent
Geocountry, city, region, postal, timezone, latitude, longitude, org, ip_address
UTMutm_source, utm_medium, utm_campaign, utm_term, utm_content, utm_id

Geo is resolved from the visitor's IP, not the browser geolocation API, so no location prompt is shown. country is normalized to a full name like "United States" and coordinates are rounded to protect precise location. Device is parsed from the user agent and screen at session start.

Configure

Auto-capture is off by default. Turn it on, then narrow what it records two ways: by event name (drop the events you don't want) and by path (skip whole sections of the site). Configure it once at load, or change it live at runtime.

At load

On the script tag, or in Trodo.init for the npm package:

<script
  src="https://cdn.trodo.ai/scripts/analytics/trodo.script.min.js"
  site-id="YOUR_SITE_ID"
  auto-events="true"
  auto-events-disabled-events="js_error,network_error,page_performance"
  auto-events-disabled-paths="/admin,/internal">
</script>

auto-events-disabled-paths and auto-events-disabled-events are comma-separated. Paths match by prefix and are case-sensitive: /admin also skips /admin/users.

At runtime

Every load-time setting has a runtime equivalent on the global Trodo, so you can toggle capture in response to app state (a route change, a settings switch, a consent banner):

Trodo.disableAutoEvents();                                // pause all auto-capture
Trodo.enableAutoEvents();                                 // resume

Trodo.disableAutoEvent(['js_error', 'network_error']);    // drop specific events
Trodo.enableAutoEvent('rage_click');                      // add one back

Trodo.setAutoEventsDisabledPaths(['/admin', '/billing']); // replace the path skip-list
Trodo.setAutoEventsDisabledEvents(['page_scroll']);       // replace the event skip-list

Trodo.getAvailableAutoEvents();                           // the full list of event names
Trodo.getAutoEventsConfig();                              // { enabled, disabledPaths, disabledEvents, currentPath, shouldTrack }

Auto-capture and custom events both respect a consent flag. Gate tracking behind your cookie or privacy banner:

Trodo.setTrackingConsent(false); // stop sending events (e.g. before the user opts in)
Trodo.setTrackingConsent(true);  // resume after they accept
Trodo.getTrackingConsent();      // current value

While consent is false, nothing is sent, auto or custom.

Next

  • Events to add business-specific events
  • Sessions for how visits are tracked

On this page