← 返回 Skills 市场
soybelli

Millimetric Track

作者 soybelli · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
77
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install millimetric-track
功能描述
Emit analytics events to Millimetric (track, identify, batch, forget). Use when the user wants to send a custom event, log a signup/purchase/pageview, link a...
使用说明 (SKILL.md)

Millimetric Track

Send analytics events to Millimetric's API. Server-side keys only (sk_live_…). The classifier auto-derives source/medium/campaign from url + referrer + click IDs — don't try to set those yourself.

When to Use

  • User asks to log/track/emit/send/record an event
  • Linking an anonymous visitor to a known user (identify)
  • Bulk-uploading events from a backfill or webhook
  • Processing a "forget me" / GDPR erasure request
  • Wiring server-side instrumentation (Express, Fastify, Hono, Next.js route handler, cron job, queue worker)

When NOT to Use

  • Reading data → use millimetric-query
  • Connecting an AI agent to Millimetric → use millimetric-mcp-setup
  • Browser instrumentation → tell the user to drop in the \x3Cscript src="https://cdn.millimetric.ai/v1/a.js" data-key="pk_live_…"> snippet instead — pk_* keys must never appear in shell or server code

Setup

export MILLIMETRIC_KEY=sk_live_...     # server key, scope: ingest
export MILLIMETRIC_HOST=https://api.millimetric.ai

For local dev against the Worker: MILLIMETRIC_HOST=http://localhost:8787.

Quick start

Track a single event

curl -X POST "$MILLIMETRIC_HOST/v1/track" \
  -H "Authorization: Bearer $MILLIMETRIC_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "signup",
    "anonymous_id": "u_abc",
    "user_id": "user_42",
    "url": "https://yoursite.com/?utm_source=facebook&utm_medium=cpc&fbclid=abc",
    "properties": { "plan": "free" }
  }'

Response: 202 Accepted, body { "ok": true, "event_id": "..." }.

Identify (link anonymous → user)

curl -X POST "$MILLIMETRIC_HOST/v1/identify" \
  -H "Authorization: Bearer $MILLIMETRIC_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "anonymous_id": "u_abc",
    "user_id": "user_42",
    "traits": { "email": "[email protected]", "plan": "pro" }
  }'

After this, include user_id on every subsequent track call for that visitor.

Batch (up to 500 events per request, ≤256 KB body)

curl -X POST "$MILLIMETRIC_HOST/v1/batch" \
  -H "Authorization: Bearer $MILLIMETRIC_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      { "event": "purchase", "anonymous_id": "u_1", "user_id": "user_1", "properties": { "amount_cents": 4900 } },
      { "event": "purchase", "anonymous_id": "u_2", "user_id": "user_2", "properties": { "amount_cents": 1900 } }
    ]
  }'

Each event in the batch supports the same fields as /v1/track. Batch is rate-limited at 5/sec, burst 20.

Forget (GDPR delete)

curl -X POST "$MILLIMETRIC_HOST/v1/forget" \
  -H "Authorization: Bearer $MILLIMETRIC_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "user_id": "user_42" }'

Requires an sk_* key — pk_* is rejected with 403 forget_requires_secret_key.

Field reference (track / batch event)

Field Required Notes
event yes 1–128 chars. System events start with $ ($pageview, $identify).
event_id no Idempotency key, 1–128 chars.
timestamp no ISO 8601. Defaults to server time.
anonymous_id no Caller-supplied UUID. Server generates one if omitted.
user_id no Stable internal user id.
session_id no Defaults to ${anonymous_id}-${30min_bucket}.
url no Landing URL with utm_*, fbclid, gclid. Classifier reads this.
path no Path only.
referrer no document.referrer or server Referer. Classifier reads this.
properties no Free-form JSON, capped at 8 KB after JSON.stringify.

The Worker enriches every event with source, medium, campaign, source_confidence, source_rule_id, country, device_type, browser, os, ip_hash. Don't send these — they're ignored.

Node SDK alternative

npm i @millimetric/track-node
import { init, track, identify, flush } from "@millimetric/track-node";

init({ key: process.env.MILLIMETRIC_KEY!, host: "https://api.millimetric.ai" });

track({
  event: "purchase",
  anonymous_id: req.cookies.aid,
  user_id: user.id,
  properties: { amount_cents: 4900, currency: "usd" }
});

await flush();   // important in serverless handlers

Common errors

Status error Fix
400 invalid_payload event missing or properties > 8 KB.
401 malformed_api_key Key doesn't match (pk|sk|rk)_*_*_*.
401 invalid_api_key Key not found in DB.
403 origin_not_allowed Using pk_* from a non-allowlisted origin — switch to sk_* for server-side.
403 forget_requires_secret_key /v1/forget called with pk_*.
429 rate_limited Back off using the Retry-After header. Track: 50/s, burst 200. Batch: 5/s, burst 20.

Key hygiene

  • pk_live_… → browser snippet only. Never paste into shell, server code, or this skill.
  • sk_live_… → server-side ingest. Use here.
  • rk_live_… → read-only — for the query skill, not this one.

See also

  • Query/analytics → millimetric-query
  • AI agent / MCP setup → millimetric-mcp-setup
  • Attribution rules: https://api.millimetric.ai (docs/concepts/attribution.md)
安全使用建议
This skill appears safe to install if you want the agent to send Millimetric analytics events. Treat MILLIMETRIC_KEY as a secret, verify the API host, confirm bulk imports and forget/delete requests, and avoid sending unnecessary personal data in traits or properties.
功能分析
Type: OpenClaw Skill Name: millimetric-track Version: 1.0.0 The millimetric-track skill is a standard API integration for the Millimetric analytics platform. It provides clear instructions and curl examples for tracking events, identifying users, and managing GDPR requests via the official API endpoint (https://api.millimetric.ai). The skill requires a standard environment variable (MILLIMETRIC_KEY) for authentication and does not exhibit any signs of data exfiltration, malicious execution, or prompt injection.
能力标签
cryptocan-make-purchasesrequires-sensitive-credentials
能力评估
Purpose & Capability
The stated purpose matches the documented capabilities: track, identify, batch, and forget analytics events. These are account-data mutations, but they are disclosed and purpose-aligned.
Instruction Scope
The instructions frame use around user-requested analytics actions and provide cURL examples. Bulk imports and GDPR forget/delete requests should still be confirmed because they can materially change analytics data.
Install Mechanism
There is no install spec and no code files. The only install-like step is an optional unpinned Node SDK alternative, which is documented rather than automatically executed.
Credentials
The required curl binary and MILLIMETRIC_KEY credential are proportionate for a server-side analytics API integration. The host override should be kept to trusted Millimetric or local-development endpoints because the bearer key is sent there.
Persistence & Privilege
No local persistence or background behavior is shown. The skill does persist or erase remote analytics records through Millimetric, which is expected for this purpose.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install millimetric-track
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /millimetric-track 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of millimetric-track. - Enables sending analytics events to Millimetric's API (track, identify, batch, forget). - Supports server-side ingestion using secret keys (`sk_live_...`), not for client-side/browser use. - Provides clear guidance on field usage, error handling, batching, and GDPR erasure. - Includes setup instructions, quickstart examples (curl and Node), and explains when to use this skill vs. alternatives. - Emphasizes key security and hygiene practices. - References related skills for querying and AI agent connections.
元数据
Slug millimetric-track
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Millimetric Track 是什么?

Emit analytics events to Millimetric (track, identify, batch, forget). Use when the user wants to send a custom event, log a signup/purchase/pageview, link a... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 77 次。

如何安装 Millimetric Track?

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

Millimetric Track 是免费的吗?

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

Millimetric Track 支持哪些平台?

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

谁开发了 Millimetric Track?

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

💬 留言讨论