HumanBehavior SDK automatically tracks several types of user interactions and errors to help you identify issues and improve user experience. These features work automatically without any additional configuration. The SDK automatically sends events for common interactions like page views, button clicks, and form submissions. You can also track your own events – see the Custom Events guide for more information.Documentation Index
Fetch the complete documentation index at: https://docs.humanbehavior.co/llms.txt
Use this file to discover all available pages before exploring further.
At a Glance
| Feature | Default | What It Tracks | Event Name |
|---|---|---|---|
| Page Views | Always On | Page loads and navigation | $page_viewed |
| Button Clicks | Enabled* | Button click interactions | $button_clicked |
| Form Submissions | Enabled* | Form submit events | $form_submitted |
| Rage Click | Always On | 3+ clicks in 1s within 30px | $rageclick |
| Network Errors | Enabled | Failed/slow HTTP requests | Network error logs |
| Console Errors | Enabled | console.warn() / console.error() | Console error logs |
enableAutomaticTracking: true (default)
Page Views ($page_viewed)
Automatically tracked on page loads and navigation events.
When It’s Triggered:
- Initial page load
- Navigation via
pushState(SPA routing) - Navigation via
replaceState(SPA routing) - Browser back/forward (
popstate) - Hash changes (
hashchange)
Button Clicks ($button_clicked)
Automatically tracked when users click buttons (when automatic tracking is enabled).
When It’s Triggered:
- User clicks any
<button>element - User clicks elements inside a button
Form Submissions ($form_submitted)
Automatically tracked when users submit forms (when automatic tracking is enabled).
When It’s Triggered:
- User submits any
<form>element
Rage Click Detection
Rage clicks occur when users repeatedly click the same area, indicating frustration with unresponsive UI elements.How It Works
The SDK automatically detects rage clicks when:- 3 or more clicks occur within 1 second
- All clicks are within a 30px radius of each other
$rageclick event is automatically sent with details about the clicked element.
Event Properties
Use Cases
- Identify broken buttons - Users clicking repeatedly on non-functional elements
- Detect UI responsiveness issues - Slow-loading pages causing user frustration
- Find confusing interfaces - Areas where users are unsure if their click registered
Example
Network Error Tracking
The SDK automatically tracks network errors and slow requests to help you identify API issues and performance problems.What Gets Tracked
Automatic Tracking:- Failed HTTP requests (4xx, 5xx status codes)
- Network errors (timeouts, connection failures, CORS errors)
- Blocked requests (ad blockers, browser extensions)
- Slow requests (>10 seconds loading time)
client_error- 4xx status codesserver_error- 5xx status codestimeout_error- Request timeoutnetwork_error- Network connection failurecors_error- CORS policy violationblocked_by_client- Blocked by ad blocker or extensioncsp_violation- Content Security Policy violationlong_loading- Request taking >10 seconds
What’s NOT Tracked
The SDK automatically skips tracking its own requests to the ingestion server to avoid infinite loops.Configuration
Network tracking is enabled by default. To disable it:React Provider
For complete configuration options, see the Options Configuration guide.
Tracked Data
Each network error includes:- Request URL and method
- HTTP status code (if available)
- Error type and message
- Request duration
- Timestamp
- Session and user context
Console Log Tracking
The SDK automatically tracks console warnings and errors to help you identify JavaScript errors in production.What Gets Tracked
Automatic Tracking:console.warn()callsconsole.error()calls- Stack traces (when available)
- Error messages and context
console.log()calls (not tracked to reduce noise)- SDK’s own console output (automatically filtered)
Configuration
Console tracking is enabled by default. To disable it:React Provider
For complete configuration options, see the Options Configuration guide.
Tracked Data
Each console error/warning includes:- Log level (
warnorerror) - Message content
- Stack trace (if available)
- Current page URL
- User agent
- Timestamp
- Session and user context
Example
Viewing Tracked Events
All automatic tracking events appear in your HumanBehavior dashboard:- Page Views - View as
$page_viewedevents - Button Clicks - View as
$button_clickedevents - Form Submissions - View as
$form_submittedevents - Rage Clicks - View as
$rageclickevents - Network Errors - View in network error logs
- Console Errors - View in console error logs
Best Practices
When to Enable/Disable Tracking
Enable Network Tracking (default):- Production environments
- When you want to monitor API health
- Debugging performance issues
- Development environments with noisy network logs
- When using third-party APIs that frequently fail
- Production environments
- When you want to catch JavaScript errors
- Debugging user-reported issues
- Development environments with verbose logging
- When using libraries that log warnings frequently
Privacy Considerations
- Network errors include request URLs (may contain sensitive data)
- Console errors include error messages (may contain sensitive data)
- Rage clicks include element text (may contain user input)
