> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/mixpanel/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Capture Events

> Learn how to track user actions with events

## 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:

1. **Track Events** - Manually track specific user actions
2. **Autocapture** - Automatically capture common interactions

## Choose Your Approach

<CardGroup cols={2}>
  <Card title="Track Events" icon="code" href="/quickstart/capture-events/track-events">
    Manually track specific user actions with custom properties
  </Card>

  <Card title="Autocapture" icon="wand-magic-sparkles" href="/quickstart/capture-events/autocapture">
    Automatically capture clicks, page views, and more (JavaScript only)
  </Card>
</CardGroup>

## Track Events

The `track` 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

```javascript theme={null}
mixpanel.track('Sign Up', {
  'Signup Type': 'Referral',
  'Plan': 'Premium'
})
```

[Learn more about tracking events →](/quickstart/capture-events/track-events)

## 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

```javascript theme={null}
mixpanel.init('YOUR_PROJECT_TOKEN', {
  autocapture: true
});
```

[Learn more about autocapture →](/quickstart/capture-events/autocapture)

## Best Practices

<Tip>
  **Start with key events**: Focus on tracking 5-10 critical user actions that align with your business goals.
</Tip>

<Tip>
  **Use consistent naming**: Establish a naming convention for events (e.g., "Verb + Noun" like "Video Played" or "Article Viewed").
</Tip>

<Tip>
  **Add meaningful properties**: Include contextual information that will help you analyze events later.
</Tip>

<Warning>
  **Avoid tracking sensitive data**: Never track passwords, credit card numbers, or other personally identifiable information (PII) unless required.
</Warning>

## 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:

1. **Use Autocapture** for general user behavior and quick insights
2. **Use Track Events** for business-critical actions with specific properties

This hybrid approach gives you comprehensive coverage without requiring extensive manual instrumentation.

## Next Steps

<Steps>
  <Step title="Set Up Track Events">
    Start by implementing manual tracking for your most important user actions

    [Track Events Guide →](/quickstart/capture-events/track-events)
  </Step>

  <Step title="Enable Autocapture (Optional)">
    Add autocapture to capture additional interactions automatically

    [Autocapture Guide →](/quickstart/capture-events/autocapture)
  </Step>

  <Step title="Test Your Implementation">
    Verify events are flowing into Mixpanel correctly

    [View Events in Mixpanel →](https://mixpanel.com/report/events)
  </Step>
</Steps>

## FAQ

<AccordionGroup>
  <Accordion title="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.
  </Accordion>

  <Accordion title="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.
  </Accordion>

  <Accordion title="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)

    Avoid tracking sensitive data or high-cardinality values (like timestamps or random IDs).
  </Accordion>

  <Accordion title="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](/docs/data-governance/lexicon) feature to add descriptions and hide unused events instead.
  </Accordion>
</AccordionGroup>
