← 返回 Skills 市场
soybelli

Millimetric Query

作者 soybelli · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
99
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install millimetric-query
功能描述
Query Millimetric analytics — top sources, aggregate stats, raw events, and the Facebook social-vs-paid split. Use when the user asks "where does my traffic...
使用说明 (SKILL.md)

Millimetric Query

Read-only analytics queries against Millimetric. Uses an rk_live_… key (read scope). The headline feature is /v1/sources — it's the endpoint that surfaces Facebook social vs Facebook paid as separate rows.

When to Use

  • User asks for traffic sources, breakdowns, top channels
  • "How many signups / purchases / pageviews in the last N days"
  • Facebook (or any source) paid-vs-organic split
  • Pulling raw events for debugging or ad-hoc analysis
  • Building a quick dashboard / cron report from the CLI

When NOT to Use

  • Sending events → millimetric-track
  • Connecting an agent natively → millimetric-mcp-setup (MCP is usually nicer for AI)

Setup

export MILLIMETRIC_RK=rk_live_...                   # read-only key
export MILLIMETRIC_HOST=https://api.millimetric.ai

Quick start

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",   "events": 6, "uniques": 6, "paid_share": 1.0 }
{ "source": "facebook", "medium": "social", "events": 3, "uniques": 3, "paid_share": 0.0 }

For "what % of each source is paid", use breakdown=sourcepaid_share becomes meaningful (0.0 → 1.0).

Aggregate stats

# Daily signups 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=signup" \
  --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 filter
group_by comma list — any of source, medium, campaign, country, device_type, browser, os, path, event_name
interval hour, day, week, month (omit for a single bucket)

Raw events

curl -sG "$MILLIMETRIC_HOST/v1/query" \
  -H "Authorization: Bearer $MILLIMETRIC_RK" \
  --data-urlencode "from=2026-05-01T00:00:00Z" \
  --data-urlencode "to=2026-05-17T00:00:00Z" \
  --data-urlencode "event=signup" \
  --data-urlencode "limit=100" | jq

Filters: 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 signups by country, last 7 days"

curl -sG "$MILLIMETRIC_HOST/v1/stats" \
  -H "Authorization: Bearer $MILLIMETRIC_RK" \
  --data-urlencode "metric=uniques" \
  --data-urlencode "event=signup" \
  --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/query" \
  -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 set by the server-side classifier. The rule cascade (first-match):

  1. Network click IDs (gclid, msclkid, ttclid, li_fat_id) → paid / high
  2. fbclid via l.facebook.com / lm.facebook.com → facebook/paid / high
  3. fbclid + utm_source=facebook|instagram|meta → paid / high
  4. utm_medium=cpc|paid|paid_social|cpm|display → paid / high
  5. fbclid alone → facebook/paid / medium
  6. Explicit UTM → source/utm_medium / high
  7. Facebook referrer, no fbclid → facebook/social / medium
  8. Other social referrers (twitter, linkedin, reddit, tiktok, …) → social / medium
  9. Search engines → organic / medium
  10. Email clients → email/email / medium
  11. Same-host referrer → internal/direct / high
  12. Nothing → direct/direct / high
  13. Else → host slug / referral / low

source_rule_id lets you audit which rule matched.

Common errors

Status error Fix
401 invalid_api_key Wrong key; must be rk_*.
403 insufficient_scope Used pk_*/sk_* — read endpoints want rk_*.
400 invalid_group_by Unknown column in group_by.
400 invalid_params Bad ISO dates or out-of-range limit.

See also

  • Sending events → millimetric-track
  • Native MCP for agents → millimetric-mcp-setup
安全使用建议
This skill appears safe for its stated read-only analytics purpose. Before installing, confirm you intend to let the agent query Millimetric, use a read-only rk_* key, keep MILLIMETRIC_HOST pointed at the official Millimetric API, and avoid requesting or sharing broader raw event data than necessary.
功能分析
Type: OpenClaw Skill Name: millimetric-query Version: 1.0.0 The skill bundle provides standard instructions and examples for querying the Millimetric analytics API using curl and jq. It requires a read-only API key (MILLIMETRIC_RK) and performs legitimate data retrieval tasks such as fetching traffic sources and event statistics from api.millimetric.ai without any signs of malicious intent or data exfiltration.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The skill is coherently focused on read-only Millimetric analytics queries, but it can retrieve raw events and user/anonymous ID filtered data.
Instruction Scope
The instructions are scoped to user-requested analytics questions and use read-only GET-style API queries; no destructive actions, goal overrides, or hidden behaviors are shown.
Install Mechanism
This is an instruction-only skill with no code files. The only install item is jq via Homebrew, with curl and jq required for documented command examples.
Credentials
The required MILLIMETRIC_RK credential is proportionate for querying the Millimetric API, but users should ensure it is an rk_* read key and keep it private.
Persistence & Privilege
No persistence, background process, local indexing, privilege escalation, or mutation authority is shown in the artifacts.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install millimetric-query
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /millimetric-query 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release — query Millimetric analytics from the command line. - Supports querying top sources (with Facebook social vs paid split), aggregate stats, and raw event data. - Designed for read-only analytics use with an rk_live_* API key. - CLI recipes provided for common analytics questions like "FB paid vs organic", signups by country, and user history. - Requires jq and curl. - Error codes and troubleshooting guidance included.
元数据
Slug millimetric-query
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Millimetric Query 是什么?

Query Millimetric analytics — top sources, aggregate stats, raw events, and the Facebook social-vs-paid split. Use when the user asks "where does my traffic... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 99 次。

如何安装 Millimetric Query?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install millimetric-query」即可一键安装,无需额外配置。

Millimetric Query 是免费的吗?

是的,Millimetric Query 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Millimetric Query 支持哪些平台?

Millimetric Query 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Millimetric Query?

由 soybelli(@soybelli)开发并维护,当前版本 v1.0.0。

💬 留言讨论