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
| Event | Fires when |
|---|---|
page_view | Page load, plus SPA route and hash changes |
element_click | Any click, with element and coordinate context |
rage_click | 3+ clicks on the same element in 1s (frustration) |
dead_click | Click on a non-interactive element with no navigation |
page_scroll | A new maximum scroll depth is reached |
text_selection | 3+ characters selected |
element_view | An element with an id is 50%+ visible for 1s |
form_submit | An HTML form is submitted (field values never captured) |
form_validation_error | A field fails native validation |
form_abandoned | The page unloads with a touched, unsubmitted form |
media_play / media_pause | A <video> or <audio> plays or pauses |
js_error | An uncaught error or unhandled promise rejection |
network_error | An SDK request to Trodo fails or returns 4xx/5xx |
page_performance | Core 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:
| Group | Properties |
|---|---|
| Session | session_id, user_id, distinct_id |
| Page | page_url, page_title, page_path, referrer |
| Device | browser_name, browser_version, os, device_type, resolution, language, user_agent |
| Geo | country, city, region, postal, timezone, latitude, longitude, org, ip_address |
| UTM | utm_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 }Consent
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 valueWhile consent is false, nothing is sent, auto or custom.