DataFast Analytics:实时网站指标与洞察 - Openclaw Skills

作者:互联网

2026-03-29

AI教程

什么是 DataFast Analytics?

Openclaw Skills 的 DataFast Analytics 技能为开发人员和营销人员提供了一个强大的接口,用于以编程方式访问网站性能数据。通过利用 DataFast API,该技能可以检索从高层概览指标到细粒度的实时统计数据和访问者细分的所有内容。

在 Openclaw Skills 工作流程中集成此工具可以自动报告会话、跳出率和收入指标。它将复杂的 API 交互简化为人类可读的摘要和可操作的表格,无需手动查看仪表板即可轻松监控网站健康状况和营销表现。

下载入口:https://github.com/openclaw/skills/tree/main/skills/bennyqp/datafast-analytics

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install datafast-analytics

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 datafast-analytics。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

DataFast Analytics 应用场景

  • 在产品发布期间跟踪实时访问者人数和地理位置。
  • 生成月度绩效报告,比较不同活动和推荐来源的流量。
  • 监控转化目标和支付事件,以计算数字营销工作的投资回报率 (ROI)。
  • 分析技术细分数据(如浏览器版本和操作系统),以指导开发优先级。
  • 自动管理和清理目标或支付数据,以便进行维护。
DataFast Analytics 工作原理
  1. 确定分析请求类型,如时间序列报告、实时概览或特定细分。
  2. 收集必要参数,包括日期范围(startAt/endAt)、时区以及访问者或会话等特定数据字段。
  3. 找到存储在本地配置目录中的 DataFast API 密钥以验证请求。
  4. 使用标准的 curl 命令构建并执行对相关 DataFast v1 端点的 API 调用。
  5. 处理 JSON 响应,生成结构化表格和突出最显著趋势的叙述性摘要。

DataFast Analytics 配置指南

  1. 从 DataFast 帐户设置中获取您的 DataFast API 密钥(以前缀 df_ 开头)。
  2. 创建所需的配置目录并将密钥保存到文件中:
mkdir -p ~/.config/datafast
echo "df_your_key_here" > ~/.config/datafast/api_key
  1. 该技能将自动读取此密钥,以便在 Openclaw Skills 环境中验证请求。

DataFast Analytics 数据架构与分类体系

该技能将分析数据组织为几个逻辑类别,以便进行清晰的报告:

数据类别 描述
指标 核心计数,如访问者、会话和跳出率。
细分 按设备、页面、营销活动、国家或浏览器细分的数据。
时间序列 特定间隔(如小时、天或周)的性能数据。
访问者详情 与特定访问者 ID 相关的细粒度元数据。
目标/支付 与特定目标相关的转化事件和财务数据。
name: datafast-analytics
description: Query DataFast website analytics and visitor data via the DataFast API for metrics, time series, realtime stats, breakdowns, visitor details, and goal/payment management.
metadata: {"openclaw":{"homepage":"https://datafa.st"}}

DataFast Analytics Skill

Use this skill to call the DataFast API and summarize results for the user.

Quick Workflow

  1. Confirm the request type (overview, timeseries, realtime, breakdown, visitor, goals/payments create/delete).
  2. Gather required inputs:
    • Date range: startAt and endAt together or neither (overview/timeseries support ranges).
    • timezone, fields, interval, limit, offset, and any filter_* parameters.
  3. Build the HTTP request with Authorization: Bearer $DATAFAST_API_KEY and Content-Type: application/json.
  4. Execute with curl and parse JSON.
  5. Summarize results in a table plus a short narrative (totals + key takeaways). Include pagination info if relevant.

Setup

  1. Get your API key from DataFast (starts with df_).
  2. Store it:
mkdir -p ~/.config/datafast
echo "df_your_key_here" > ~/.config/datafast/api_key

Authentication

All requests need:

DATAFAST_API_KEY=$(cat ~/.config/datafast/api_key)
curl ... r
  -H "Authorization: Bearer $DATAFAST_API_KEY" r
  -H "Content-Type: application/json"

If the user hasn't set up the API key, ask them to follow the setup steps above.

Base URL

https://datafa.st/api/v1/

Reference Docs

Use the full API reference at {baseDir}/references/datafast-api-docs.md for endpoint details, response fields, and examples.

Endpoint Guidance

Overview

  • GET /analytics/overview
  • Optional: startAt, endAt, timezone, fields.

Time Series

  • GET /analytics/timeseries
  • Typical params: fields, interval (hour/day/week/month), startAt, endAt, timezone, limit, offset.
  • Accepts filter_* query params for segmentation.
  • Note: fields is required (e.g., fields=visitors,sessions).

Realtime

  • GET /analytics/realtime
  • GET /analytics/realtime/map

Breakdowns

  • GET /analytics/devices
  • GET /analytics/pages
  • GET /analytics/campaigns
  • GET /analytics/goals
  • GET /analytics/referrers
  • GET /analytics/countries
  • GET /analytics/regions
  • GET /analytics/cities
  • GET /analytics/browsers
  • GET /analytics/operating-systems
  • GET /analytics/hostnames

Visitor Details

  • GET /visitors/{datafast_visitor_id}

Goals

  • Create goal: POST /goals
  • Delete goals: DELETE /goals (requires at least one filter or time range; confirm scope)

Payments

  • Create payment: POST /payments
  • Delete payments: DELETE /payments (confirm scope)

Destructive Actions

For DELETE /goals or DELETE /payments:

  • Always confirm exact filters and time range in plain English before executing.
  • If user asks for "all time" deletion, ask for explicit confirmation.
  • Echo the final URL that will be called (without the API key).

Filter Syntax

Use filter_* params for segmentation (e.g., filter_referrer=is:X).

Important: Filter values must match the exact names from breakdown endpoints. For example, X/Twitter is stored as "X" (not "x.com" or "twitter.com"). When in doubt, query the breakdown first:

curl ... "/analytics/referrers?limit=20"

Then use the exact referrer value in your filter.

Example Command Patterns

GET

DATAFAST_API_KEY=$(cat ~/.config/datafast/api_key)
curl -sS "https://datafa.st/api/v1/analytics/overview?startAt=2024-01-01&endAt=2024-01-31&timezone=UTC" r
  -H "Authorization: Bearer $DATAFAST_API_KEY" r
  -H "Content-Type: application/json"

POST

DATAFAST_API_KEY=$(cat ~/.config/datafast/api_key)
curl -sS "https://datafa.st/api/v1/goals" r
  -H "Authorization: Bearer $DATAFAST_API_KEY" r
  -H "Content-Type: application/json" r
  -d '{"datafast_visitor_id":"...","name":"newsletter_signup","metadata":{"email":"..."}}'

DELETE

DATAFAST_API_KEY=$(cat ~/.config/datafast/api_key)
curl -sS -X DELETE "https://datafa.st/api/v1/goals?name=signup&startAt=2023-01-01T00:00:00Z&endAt=2023-01-31T23:59:59Z" r
  -H "Authorization: Bearer $DATAFAST_API_KEY"

Output Expectations

  • Provide a short summary and a flat table of results.
  • Include totals and conversion/revenue metrics when present.
  • For time series, include the top-level totals and the first/last timestamps in the selected range.
  • If pagination exists, report limit, offset, and total, and ask if the user wants the next page.