# Observability > Mixpanel

# Mixpanel

Artillery can send test events to [Mixpanel](https://mixpanel.com) for product analytics and performance tracking.

## Quick Start

```yaml
plugins:
  publish-metrics:
    - type: mixpanel
      projectToken: '{{ $env.MIXPANEL_PROJECT_TOKEN }}'
```

## Configuration

To send data to Mixpanel, set `type` to `mixpanel` and provide your [project token](https://developer.mixpanel.com/reference/authentication).

### Configuration Options

| Name           | Description                                            |
| -------------- | ------------------------------------------------------ |
| `projectToken` | Your Mixpanel project token (required)                |

## What Gets Sent

Artillery sends test metrics as events to Mixpanel, which can be used to:

* Track performance trends over time
* Correlate load test results with product metrics
* Create dashboards combining load test and user analytics data

## Examples

### Basic Configuration

```yaml
config:
  plugins:
    publish-metrics:
      - type: mixpanel
        projectToken: 'my-mixpanel-project-token'
```

### Using Environment Variable

```yaml
config:
  plugins:
    publish-metrics:
      - type: mixpanel
        projectToken: '{{ $env.MIXPANEL_PROJECT_TOKEN }}'
```

## Analyzing Data in Mixpanel

Once data is in Mixpanel, you can:

1. **Create custom reports** to visualize performance metrics
2. **Set up alerts** for performance degradations
3. **Build dashboards** that combine load test data with user behavior
4. **Track trends** to see how performance changes over releases

## Best Practices

1. **Use consistent event names**: This makes it easier to create reports and track trends
2. **Include metadata**: Add custom properties to events for better filtering
3. **Correlate with releases**: Include version numbers or deployment IDs to track performance across releases

## Debugging

Set `DEBUG=plugin:publish-metrics:mixpanel` when running your tests to print out helpful debugging messages:

```sh
DEBUG=plugin:publish-metrics:mixpanel artillery run my-script.yaml
```

## Use Cases

* **Product teams**: Understand how performance impacts user behavior
* **Engineering teams**: Track performance trends across deployments
* **Business teams**: Correlate performance with business metrics
