← 返回
数据分析 Key 中文

Mixpanel

Query Mixpanel analytics with funnels, retention, segmentation, and event tracking via REST API.
通过 REST API 查询 Mixpanel 分析数据,支持漏斗、留存、细分及事件追踪。
ivangdavila
数据分析 clawhub v1.0.1 1 版本 100000 Key: 需要
★ 0
Stars
📥 810
下载
💾 13
安装
1
版本
#latest

概述

Setup

On first use, read setup.md for integration guidelines.

When to Use

User needs product analytics from Mixpanel. Agent handles event queries, funnel analysis, retention cohorts, user segmentation, and profile lookups.

Architecture

Memory lives in ~/mixpanel/. See memory-template.md for structure.

~/mixpanel/
├── memory.md        # Projects, saved queries, insights
└── queries/         # Saved JQL queries

Quick Reference

TopicFile
-------------
Setup processsetup.md
Memory templatememory-template.md

Core Rules

1. Authentication

Requires a Mixpanel Service Account:

export MP_SERVICE_ACCOUNT="your-service-account"
export MP_SERVICE_SECRET="your-service-secret"
export MP_PROJECT_ID="123456"

Create a service account in Mixpanel → Organization Settings → Service Accounts.

2. Query API for Analysis

Use the Query API for insights, funnels, retention:

BASE="https://mixpanel.com/api/query"
AUTH=$(echo -n "$MP_SERVICE_ACCOUNT:$MP_SERVICE_SECRET" | base64)

# Insights query (event counts)
curl -s "$BASE/insights?project_id=$MP_PROJECT_ID" \
  -H "Authorization: Basic $AUTH" \
  -H "Content-Type: application/json" \
  -d '{
    "params": {
      "event": ["Sign Up", "Purchase"],
      "type": "general",
      "unit": "day",
      "from_date": "2024-01-01",
      "to_date": "2024-01-31"
    }
  }' | jq

3. Funnel Analysis

curl -s "$BASE/funnels?project_id=$MP_PROJECT_ID" \
  -H "Authorization: Basic $AUTH" \
  -H "Content-Type: application/json" \
  -d '{
    "params": {
      "events": [
        {"event": "Sign Up"},
        {"event": "Complete Onboarding"},
        {"event": "First Purchase"}
      ],
      "from_date": "2024-01-01",
      "to_date": "2024-01-31",
      "unit": "day"
    }
  }' | jq '.data.meta.overall'

4. Retention Cohorts

curl -s "$BASE/retention?project_id=$MP_PROJECT_ID" \
  -H "Authorization: Basic $AUTH" \
  -H "Content-Type: application/json" \
  -d '{
    "params": {
      "born_event": "Sign Up",
      "event": "App Open",
      "from_date": "2024-01-01",
      "to_date": "2024-01-31",
      "unit": "week",
      "retention_type": "birth"
    }
  }' | jq

5. User Profiles

curl -s "https://mixpanel.com/api/query/engage?project_id=$MP_PROJECT_ID" \
  -H "Authorization: Basic $AUTH" \
  -H "Content-Type: application/json" \
  -d '{
    "filter_by_cohort": {"id": 12345},
    "output_properties": ["$email", "$name", "plan"]
  }' | jq

6. Export Raw Events

curl -s "https://data.mixpanel.com/api/2.0/export?project_id=$MP_PROJECT_ID" \
  -H "Authorization: Basic $AUTH" \
  -d "from_date=2024-01-01" \
  -d "to_date=2024-01-07" \
  -d "event=[\"Purchase\"]"

7. JQL for Complex Queries

// Mixpanel JQL (JavaScript Query Language)
function main() {
  return Events({
    from_date: "2024-01-01",
    to_date: "2024-01-31",
    event_selectors: [{event: "Purchase"}]
  })
  .groupByUser(["properties.$city"], mixpanel.reducer.sum("properties.amount"))
  .groupBy(["key.$city"], mixpanel.reducer.avg("value"))
  .sortDesc("value")
  .take(10);
}

Common Queries

GoalEndpointKey Params
----------------------------
Event counts/insightsevent, type, unit, dates
Conversion funnel/funnelsevents array, dates
User retention/retentionborn_event, event, unit
User segments/engagefilter_by_cohort, properties
Raw event export/exportdates, event filter

Mixpanel Traps

  • Wrong date format → use YYYY-MM-DD, not timestamps
  • Missing project_id → every Query API call needs it
  • Rate limits → 60 requests/hour for free tier, batch queries when possible
  • JQL timeouts → queries over 60s fail, add .take(N) to limit results

External Endpoints

EndpointData SentPurpose
------------------------------
mixpanel.com/api/query/*Credentials, project ID, query paramsAnalytics queries
data.mixpanel.com/api/2.0/*Credentials, project ID, date rangeRaw data export

No other data is sent externally.

Security & Privacy

Data sent to Mixpanel (over HTTPS):

  • Service account credentials for authentication
  • Query parameters (event names, date ranges, filters)
  • Project ID

Data that stays local:

  • Credentials stored ONLY in environment variables
  • Query results cached in ~/mixpanel/

This skill does NOT:

  • Store credentials in memory.md or any file
  • Send data to services other than mixpanel.com
  • Modify your Mixpanel tracking code or SDK

Trust

By using this skill, analytics data is queried from Mixpanel.

Only install if you trust Mixpanel with your product data.

Related Skills

Install with clawhub install if user confirms:

  • analytics — multi-platform analytics
  • data-analysis — data processing patterns
  • api — REST API best practices

Feedback

  • If useful: clawhub star mixpanel
  • Stay updated: clawhub sync

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-29 13:43 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 438 📥 147,656
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,358 📥 318,365
data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 270 📥 56,973