360 Secure SkillHub
360 安全技能中心

Amplitude

调用 Amplitude API 的事件追踪与产品分析技能:可上报事件与用户属性、查询活跃用户、事件分段、漏斗转化、留存、收入及分群数据。脚本为纯 Python 标准库 CLI,默认输出 JSON,加 --human 输出可读文本,需 Amplitude API Key 与 Secret Key。

aiwithabidi
aiwithabidi
热度 77.87
最近更新 2026-05-10 17:38:32
分类:数据依赖:代码执行 / 第三方 API应用场景:报告撰写 / 数据处理 / 市场分析 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add amplitude
Metadata
name
amplitude
description
Amplitude product analytics — track events, analyze user behavior, run cohort analysis, manage user properties, and query funnel/retention data via the Amplitude API. Understand product usage, measure feature adoption, and analyze user journeys. Built for AI agents — Python stdlib only, zero dependencies. Use for product analytics, user behavior tracking, funnel analysis, retention analysis, and cohort segmentation.
homepage
https://www.agxntsix.ai
license
MIT
compatibility
Python 3.10+ (stdlib only — no dependencies)
metadata
{"openclaw":{"emoji":"📉","requires":{"env":["AMPLITUDE_API_KEY","AMPLITUDE_SECRET_KEY"]},"primaryEnv":"AMPLITUDE_API_KEY","homepage":"https://www.agxntsix.ai"}}

📉 Amplitude

Amplitude product analytics — track events, analyze user behavior, run cohort analysis, manage user properties, and query funnel/retention data via the Amplitude API.

Features

  • Event tracking — log user events with properties
  • User analytics — active users, sessions, engagement
  • Funnel analysis — conversion through event sequences
  • Retention analysis — user return rates over time
  • Cohort management — create and manage user cohorts
  • User properties — set and query user attributes
  • Revenue analytics — LTV, ARPU, revenue tracking
  • Segmentation — query by properties and events
  • Event segmentation — event counts and breakdowns
  • Dashboard export — export chart data

Requirements

Variable Required Description
AMPLITUDE_API_KEY ✅ API key/token for Amplitude
AMPLITUDE_SECRET_KEY ✅ Amplitude secret key for Export/Dashboard APIs

Quick Start

# Track an event
python3 {baseDir}/scripts/amplitude.py track '{"user_id":"user123","event_type":"purchase","event_properties":{"amount":29.99}}'
# Track batch events
python3 {baseDir}/scripts/amplitude.py track-batch events.json
# Set user properties
python3 {baseDir}/scripts/amplitude.py identify '{"user_id":"user123","user_properties":{"plan":"pro","company":"Acme"}}'
# Get active user counts
python3 {baseDir}/scripts/amplitude.py active-users --start 2026-01-01 --end 2026-02-01

Commands

track

Track an event.

python3 {baseDir}/scripts/amplitude.py track '{"user_id":"user123","event_type":"purchase","event_properties":{"amount":29.99}}'

track-batch

Track batch events.

python3 {baseDir}/scripts/amplitude.py track-batch events.json

identify

Set user properties.

python3 {baseDir}/scripts/amplitude.py identify '{"user_id":"user123","user_properties":{"plan":"pro","company":"Acme"}}'

active-users

Get active user counts.

python3 {baseDir}/scripts/amplitude.py active-users --start 2026-01-01 --end 2026-02-01

events

Get event data.

python3 {baseDir}/scripts/amplitude.py events --start 2026-01-01 --end 2026-02-01 --event purchase

funnel

Run funnel analysis.

python3 {baseDir}/scripts/amplitude.py funnel '{"events":[{"event_type":"page_view"},{"event_type":"signup"},{"event_type":"purchase"}]}' --start 2026-01-01 --end 2026-02-01

retention

Retention analysis.

python3 {baseDir}/scripts/amplitude.py retention --start 2026-01-01 --end 2026-02-01

cohorts

List cohorts.

python3 {baseDir}/scripts/amplitude.py cohorts

cohort-get

Get cohort details.

python3 {baseDir}/scripts/amplitude.py cohort-get abc123

revenue

Revenue analysis.

python3 {baseDir}/scripts/amplitude.py revenue --start 2026-01-01 --end 2026-02-01

user-search

Search for a user.

python3 {baseDir}/scripts/amplitude.py user-search "user@example.com"

user-activity

Get user activity.

python3 {baseDir}/scripts/amplitude.py user-activity user123

segments

Event segmentation query.

python3 {baseDir}/scripts/amplitude.py segments --event purchase --group-by platform --start 2026-01-01 --end 2026-02-01

Output Format

All commands output JSON by default. Add --human for readable formatted output.

# JSON (default, for programmatic use)
python3 {baseDir}/scripts/amplitude.py track --limit 5

# Human-readable
python3 {baseDir}/scripts/amplitude.py track --limit 5 --human

Script Reference

Script Description
{baseDir}/scripts/amplitude.py Main CLI — all Amplitude operations

Data Policy

This skill never stores data locally. All requests go directly to the Amplitude API and results are returned to stdout. Your data stays on Amplitude servers.

Credits


Built by M. Abidi | agxntsix.ai YouTube | GitHub Part of the AgxntSix Skill Suite for OpenClaw agents.

📅 Need help setting up OpenClaw for your business? Book a free consultation