Skip to main content

Integrating with Mixpanel

This guide shows you how to integrate Superline Agent Detection with Mixpanel to distinguish between human and AI agent traffic in your analytics data.

Why Segment AI Agent Data in Mixpanel

Mixpanel is powerful for understanding user behavior and funnels, but AI agents can distort your insights by:
  • Inflating engagement metrics
  • Creating misleading user journey patterns
  • Skewing conversion funnels and rates
  • Distorting cohort analysis
By integrating Superline Agent Detection with Mixpanel, you can:
  • Filter out or separately analyze AI agent traffic
  • Compare behavior patterns between humans and AI agents
  • Create more accurate funnels based on human-only traffic
  • Make data-driven decisions based on actual human behavior

Integration Steps

1

Install Required Libraries

Install both Mixpanel and Superline Agent Detection:
If you’re using script tags instead:
2

Initialize Both Libraries

Initialize both libraries early in your application:
3

Detect and Register User Properties

After collecting enough data for detection, register the result as a Mixpanel user property:
4

Create Mixpanel Cohorts

In your Mixpanel project:
  1. Go to Data Management > Cohorts
  2. Create two cohorts:
    • Human Users: where “Is Agent” equals “false”
    • AI Agents: where “Is Agent” equals “true”
5

Set Up Segmented Reports

Create segmented reports to compare humans vs. AI agents:
  1. Create any report (Insights, Funnels, Flows, etc.)
  2. Click “Add filter” or “Segment by”
  3. Select “Is Agent” as the property
  4. Compare “true” vs “false” values

Complete Integration Example

Here’s a comprehensive integration example that covers various scenarios:
Usage of this module:

Advanced Mixpanel Features

Create separate funnels for humans and AI agents:
  1. Go to Funnels in Mixpanel
  2. Create your conversion funnel
  3. Click “Segment by” and select “Is Agent”
  4. Compare conversion rates between humans and AI agents
This reveals how conversion paths differ between humans and AI agents, and gives you a more accurate picture of your true human conversion rate.
Compare retention metrics between humans and AI agents:
  1. Go to Retention in Mixpanel
  2. Set up your retention analysis
  3. Break down by “Is Agent”
This helps identify if retention metrics are being skewed by recurring AI agents.
Use Mixpanel’s JQL (JavaScript Query Language) to perform advanced analysis:
This allows for complex filtering and analysis based on the agent detection data.

Implementation Patterns

Usage in components:

Best Practices

  1. Wait For Sufficient Data: Allow 3-5 seconds of user interaction before finalizing detection
  2. Register Super Properties: Use Mixpanel’s super properties to automatically include agent information in all events
  3. Create Segment Comparisons: Always compare key metrics between human and AI segments
  4. Use Cohorts: Create saved cohorts for humans and agents to easily apply these segments in any report
  5. Consider Confidence Thresholds: For uncertain cases (confidence around 0.4-0.6), you may want to create a third “uncertain” segment based on the Agent Confidence property, or adjust the initial detection threshold using the init option.

Next Steps

Google Analytics Integration

Learn how to integrate with Google Analytics

Custom Analytics

Integrate with other analytics platforms