Skip to main content

Overview

If you’re building a B2B product, you’ll want to track data at both the user level and the company level. Mixpanel’s Group Analytics allows you to analyze behavior by company, team, workspace, or any other group entity.
Company Analytics requires Group Analytics, which is available on Growth and Enterprise plans. Learn more about pricing.

Why Track Company Data?

Tracking at the company level allows you to:
  • Understand which companies are most engaged
  • Track account-level metrics like total users, activity, and health scores
  • Build reports showing company-level adoption and usage
  • Identify expansion opportunities
  • Monitor churn risk at the account level

Setting Up Company Analytics

Step 1: Define Your Group Key

First, decide what identifier you’ll use for companies. Common choices:
  • company_id - Your internal company identifier
  • account_id - Account ID from your database
  • organization_id - Organization identifier

Step 2: Send Group Data with Events

When tracking events, include the group identifier:
// First, add the user to a group
mixpanel.set_group('company_id', 'acme_corp');

// Then track events as normal
mixpanel.track('Feature Used', {
  'Feature Name': 'Dashboard'
});

// The company_id will automatically be included

Step 3: Set Group Properties

Just like user profiles, you can set properties on groups:
mixpanel.get_group('company_id', 'acme_corp').set({
  'Company Name': 'Acme Corporation',
  'Industry': 'Technology',
  'Plan': 'Enterprise',
  'Employee Count': 500,
  'MRR': 50000
});

Common Company Properties to Track

Company Info

  • Company Name
  • Industry
  • Company Size
  • Location/Country
  • Website

Account Details

  • Plan Type
  • MRR/ARR
  • Contract Start Date
  • Renewal Date
  • Number of Seats

Engagement Metrics

  • Active Users Count
  • Last Activity Date
  • Feature Adoption Score
  • Health Score

Success Metrics

  • Account Manager
  • CSM Assigned
  • NPS Score
  • Support Tickets

Example: Complete Company Setup

Here’s a complete example of setting up company analytics:
// 1. When user signs in, associate them with their company
mixpanel.identify('user_123');
mixpanel.set_group('company_id', 'acme_corp');

// 2. Set user properties
mixpanel.people.set({
  '$name': 'Jane Doe',
  '$email': '[email protected]',
  'Role': 'Admin'
});

// 3. Set company properties
mixpanel.get_group('company_id', 'acme_corp').set({
  'Company Name': 'Acme Corporation',
  'Plan': 'Enterprise',
  'Employee Count': 500,
  'Industry': 'Technology'
});

// 4. Track events (company_id is automatically included)
mixpanel.track('Report Created', {
  'Report Type': 'Sales Dashboard'
});

Analyzing Company Data

Once you’re sending company data, you can:

1. View Company Profiles

Navigate to Users > Groups in Mixpanel to see all companies and their properties.

2. Build Company-Level Reports

In any Mixpanel report, you can:
  • Group by company properties (e.g., Plan Type, Industry)
  • Filter by company attributes
  • View metrics aggregated at the company level

3. Create Company Cohorts

Build cohorts of companies based on:
  • Activity levels
  • Feature usage
  • Plan type
  • Health scores

Best Practices

Set the group early: Call set_group() as soon as a user logs in to ensure all subsequent events are associated with the company.
Keep properties updated: Update company properties when important changes occur (plan upgrades, seat changes, etc.).
Use consistent IDs: Use the same company identifier across all your systems for easy data integration.
Group Analytics limits: Each project can have up to 3 group keys. Plan accordingly based on your analysis needs.

Use Cases

Track Account Health

// Update company health score based on activity
function updateCompanyHealth(companyId, activityScore) {
  mixpanel.get_group('company_id', companyId).set({
    'Health Score': activityScore,
    'Last Updated': new Date().toISOString()
  });
}

Monitor Feature Adoption by Company

// Track when companies adopt new features
mixpanel.track('Feature Enabled', {
  'Feature Name': 'Advanced Reporting'
});

// Update company profile
mixpanel.get_group('company_id', 'acme_corp').set({
  'Advanced Reporting Enabled': true,
  'Features Enabled Count': 12
});

Track Expansion Revenue

// When a company upgrades
mixpanel.get_group('company_id', 'acme_corp').set({
  'Plan': 'Enterprise',
  'MRR': 50000,
  'Upgrade Date': new Date().toISOString()
});

mixpanel.track('Plan Upgraded', {
  'Previous Plan': 'Professional',
  'New Plan': 'Enterprise',
  'MRR Change': 30000
});

Next Steps

Learn More About Group Analytics

Dive deeper into Group Analytics features and capabilities

FAQ

Each Mixpanel project supports up to 3 group keys. Common setups include:
  • company_id for B2B companies
  • workspace_id for workspace-based products
  • team_id for team-based features
While technically possible, changing group keys requires re-sending historical data. It’s best to plan your group structure carefully from the start.
Users can belong to multiple groups. You can update the active group with set_group() based on which company context they’re currently working in.
  • Group properties: Attributes of the company itself (name, plan, size) that persist over time
  • Event properties: Context about a specific event occurrence (which feature, what value, etc.)
Both are useful for analysis but serve different purposes.

Build docs developers (and LLMs) love