Event Tracking Overview
Crazy Egg automatically tracks clicks and scrolls, but you can enhance tracking with custom events to capture specific user interactions.
Automatic Tracking
Crazy Egg automatically captures:
- Clicks: All click events on the page
- Scroll depth: How far users scroll
- Mouse movements: For heatmap visualization
- Form interactions: Field focus and input
No additional configuration needed for these default behaviors.
Custom Event Tracking
JavaScript API
Track custom events with the Crazy Egg API:
// Check if Crazy Egg is loaded
if (typeof CE2 !== 'undefined') {
CE2.track('event_name');
}
// With callback confirmation
CE2.track('signup_click', function() {
console.log('Event tracked');
});
Common Events to Track
// CTA interactions
CE2.track('cta_hover');
CE2.track('cta_click');
// Content engagement
CE2.track('video_play');
CE2.track('accordion_expand');
// Form events
CE2.track('form_start');
CE2.track('form_complete');
// Navigation
CE2.track('menu_open');
CE2.track('search_used');
Goal Tracking
Setting Up Goals
- Log into Crazy Egg dashboard
- Go to Goals
- Click Add Goal
- Define goal criteria:
- Page visit
- Button click
- Form submission
URL-Based Goals
Track when visitors reach specific pages:
Goal: Purchase Complete
Condition: URL contains "/thank-you"
Click-Based Goals
Track clicks on specific elements:
Goal: Add to Cart
Condition: Click on element with class "add-to-cart"
Filtering Recordings
By User Actions
Filter session recordings by events:
- Go to Recordings
- Use filters:
- Pages visited
- Elements clicked
- Goals completed
- Time on site
Custom Segments
Create segments based on behavior:
- Visitors who clicked CTA
- Users who scrolled past 50%
- Sessions with form interactions
A/B Test Events
Tracking Variant Performance
Crazy Egg automatically tracks events per variant:
- Click rates on variants
- Scroll depth per variant
- Goal completion by variant
Custom Metrics
Track custom success metrics:
// Track variant-specific action
if (typeof CE2 !== 'undefined') {
CE2.track('variant_engagement');
}
Best Practices
Event Naming
Use clear, consistent naming:
// Good
CE2.track('pricing_page_cta_click');
CE2.track('demo_video_play');
// Avoid
CE2.track('click1');
CE2.track('event');
Verification
Test events are tracking:
- Trigger the event on your site
- Check Crazy Egg dashboard
- Verify event appears in recordings
- Confirm goal tracking if applicable