Overview
Events are the foundation of Mixpanel analytics. They represent user actions or occurrences in your product. This section will teach you two ways to capture events:- Track Events - Manually track specific user actions
- Autocapture - Automatically capture common interactions
Choose Your Approach
Track Events
Manually track specific user actions with custom properties
Autocapture
Automatically capture clicks, page views, and more (JavaScript only)
Track Events
Thetrack method allows you to manually track user actions. This gives you full control over what events are tracked and what properties are included.
When to Use Track Events
- Tracking specific business-critical actions (e.g., “Purchase Completed”, “Video Watched”)
- Including custom properties with events
- Working with server-side SDKs
- Need precise control over event data
Basic Example
Autocapture
Autocapture automatically tracks common user interactions without requiring manual instrumentation. This is only available for the JavaScript SDK.When to Use Autocapture
- Quick setup without extensive code changes
- Capturing general user behavior patterns
- Tracking clicks, page views, and form submissions automatically
- Complementing your manual event tracking
Basic Example
Best Practices
Recommended Events to Track
Depending on your product type, here are some common events to consider:SaaS Products
- Sign Up
- Sign In
- Trial Started
- Feature Used
- Upgrade
- Invitation Sent
E-commerce
- Product Viewed
- Add to Cart
- Checkout Started
- Purchase Completed
- Product Reviewed
Content Platforms
- Article Viewed
- Video Played
- Comment Posted
- Content Shared
- Search Performed
Mobile Apps
- App Opened
- Screen Viewed
- Push Notification Received
- In-App Purchase
- Share
Combining Both Approaches
For the best results, many teams use both methods:- Use Autocapture for general user behavior and quick insights
- Use Track Events for business-critical actions with specific properties
Next Steps
Set Up Track Events
Start by implementing manual tracking for your most important user actionsTrack Events Guide →
Enable Autocapture (Optional)
Add autocapture to capture additional interactions automaticallyAutocapture Guide →
Test Your Implementation
Verify events are flowing into Mixpanel correctlyView Events in Mixpanel →
FAQ
Should I use Track Events or Autocapture?
Should I use Track Events or Autocapture?
Use both! Autocapture is great for getting started quickly and capturing general behavior. Track Events gives you precise control for business-critical actions. Most teams use Autocapture as a foundation and add manual tracking for their most important events.
How many events should I track?
How many events should I track?
Start small with 5-10 key events that align with your business goals. You can always add more later. Tracking too many events from the start can make analysis overwhelming.
What properties should I include with events?
What properties should I include with events?
Include properties that will help you answer questions about your product. For example:
- Event context (e.g., which screen, which feature)
- User attributes (e.g., plan type, account age)
- Business metrics (e.g., price, quantity)
Can I change event names later?
Can I change event names later?
While you technically can, it’s better to establish good naming conventions from the start. Changing event names requires updating your code and can make historical analysis difficult. Use the Lexicon feature to add descriptions and hide unused events instead.