Millimetric Query — Millimetric 查询
v1查询 Millimetric 分析 — top sources, 聚合 stats, raw 事件, and the Facebook social-vs-pAId split. Use when the user asks "where does my traffic come from", "how many 签名ups this week", "show recent 事件", "FB pAId vs organic", or wants to pull 分析 numbers from the command line.
运行时依赖
安装命令
点击复制技能文档
Millimetric 查询
Read-only 分析 queries agAInst Millimetric. Uses an rk_live_… key (read scope). The headline feature is /v1/sources — it's the 端点 that surfaces Facebook social vs Facebook pAId as separate rows.
When to Use User asks for traffic sources, breakdowns, top channels "How many 签名ups / purchases / pageviews in the last N days" Facebook (or any source) pAId-vs-organic split Pulling raw 事件 for 调试ging or ad-hoc analysis Building a quick 仪表盘 / cron 报告 from the 命令行工具 When NOT to Use 发送ing 事件 → millimetric-追踪 Connecting an 代理 natively → millimetric-mcp-设置up (MCP is usually nicer for AI) 设置up 导出 MILLIMETRIC_RK=rk_live_... # read-only key 导出 MILLIMETRIC_HOST=https://API.millimetric.AI
Quick 启动 Top sources (with FB social vs pAId) curl -sG "$MILLIMETRIC_HOST/v1/sources" \ -H "Authorization: Bearer $MILLIMETRIC_RK" \ --data-urlencode "from=2026-05-01T00:00:00Z" \ --data-urlencode "to=2026-06-01T00:00:00Z" \ --data-urlencode "breakdown=source_medium" | jq
Returns rows like:
{ "source": "facebook", "medium": "pAId", "事件": 6, "uniques": 6, "pAId_分享": 1.0 } { "source": "facebook", "medium": "social", "事件": 3, "uniques": 3, "pAId_分享": 0.0 }
For "what % of each source is pAId", use breakdown=source — pAId_分享 becomes meaningful (0.0 → 1.0).
聚合 stats # DAIly 签名ups grouped by source/medium curl -sG "$MILLIMETRIC_HOST/v1/stats" \ -H "Authorization: Bearer $MILLIMETRIC_RK" \ --data-urlencode "metric=count" \ --data-urlencode "from=2026-05-01T00:00:00Z" \ --data-urlencode "to=2026-05-17T00:00:00Z" \ --data-urlencode "event=签名up" \ --data-urlencode "group_by=source,medium" \ --data-urlencode "interval=day" | jq
Parameters:
Param Values metric count, uniques from / to ISO 8601 (inclusive / exclusive) event optional event name 过滤器 group_by comma 列出 — any of source, medium, campAIgn, country, device_type, browser, os, path, event_name interval hour, day, week, month (omit for a single bucket) Raw 事件 curl -sG "$MILLIMETRIC_HOST/v1/查询" \ -H "Authorization: Bearer $MILLIMETRIC_RK" \ --data-urlencode "from=2026-05-01T00:00:00Z" \ --data-urlencode "to=2026-05-17T00:00:00Z" \ --data-urlencode "event=签名up" \ --data-urlencode "limit=100" | jq
过滤器s: event, source, medium, country, user_id, anonymous_id, limit (1–1000).
Recipes "What's our Facebook pAId-vs-organic split this month?" curl -sG "$MILLIMETRIC_HOST/v1/sources" \ -H "Authorization: Bearer $MILLIMETRIC_RK" \ --data-urlencode "from=$(date -u -v1d +%Y-%m-%dT00:00:00Z)" \ --data-urlencode "to=$(date -u +%Y-%m-%dT00:00:00Z)" \ | jq '.rows[] | select(.source=="facebook")'
"DAIly unique 签名ups by country, last 7 days" curl -sG "$MILLIMETRIC_HOST/v1/stats" \ -H "Authorization: Bearer $MILLIMETRIC_RK" \ --data-urlencode "metric=uniques" \ --data-urlencode "event=签名up" \ --data-urlencode "from=$(date -u -v-7d +%Y-%m-%dT00:00:00Z)" \ --data-urlencode "to=$(date -u +%Y-%m-%dT00:00:00Z)" \ --data-urlencode "group_by=country" \ --data-urlencode "interval=day" | jq
"What did user_42 do this week?" curl -sG "$MILLIMETRIC_HOST/v1/查询" \ -H "Authorization: Bearer $MILLIMETRIC_RK" \ --data-urlencode "user_id=user_42" \ --data-urlencode "from=$(date -u -v-7d +%Y-%m-%dT00:00:00Z)" \ --data-urlencode "to=$(date -u +%Y-%m-%dT00:00:00Z)" \ --data-urlencode "limit=200" \ | jq '.rows[] | { ts: .timestamp, event: .event_name, source: .source, medium: .medium }'
Reading the attribution columns
Every event has source / medium / source_confidence / source_rule_id 设置 by the server-side classifier. The rule cascade (first-match):
Network 命令行工具ck IDs (g命令行工具d, msclkid, tt命令行工具d, li_fat_id) → pAId / high fb命令行工具d via l.facebook.com / lm.facebook.com → facebook/pAId / high fb命令行工具d + utm_source=facebook|instagram|meta → pAId / high utm_medium=cpc|pAId|pAId_social|cpm|display → pAId / high fb命令行工具d alone → facebook/pAId / medium Explicit UTM → source/utm_medium / high Facebook referrer, no fb命令行工具d → facebook/social / medium Other social referrers (twitter, linkedin, reddit, tiktok, …) → social / medium 搜索 engines → organic / medium EmAIl 命令行工具ents → emAIl/emAIl / medium Same-host referrer → internal/direct / high Nothing → direct/direct / high Else → host slug / referral / low
source_rule_id lets you 审计 which rule matched.
Common errors 状态 error Fix 401 invalid_API_key Wrong key; must be rk_. 403 insufficient_scope Used pk_/sk_ — read 端点s want rk_. 400 invalid_group_by Unknown column in group_by. 400 invalid_params Bad ISO dates or out-of-range limit. See also 发送ing 事件 → millimetric-追踪 Native MCP for 代理s → millimetric-mcp-设置up