← 返回
数据分析 Key 中文

Client Reporting Automation

Automated client reporting for agencies and freelancers using OpenClaw. Pull data from Google Analytics, Google Search Console, social media platforms, and c...
利用 OpenClaw 为代理商和自由职业者提供自动化客户报告,支持从 Google Analytics、Google Search Console 及各类社交媒体平台拉取数据。
reighlan
数据分析 clawhub v1.0.0 1 版本 99905.7 Key: 需要
★ 0
Stars
📥 1,060
下载
💾 16
安装
1
版本
#agency#analytics#clients#latest#reporting

概述

Client Reporting Automation

Pull metrics from multiple sources, generate branded reports, and auto-deliver to clients. Built for agencies and freelancers who need consistent, professional reporting without manual work.

Setup

Dependencies

pip3 install requests jinja2

API Keys (configure in config.json)

  • Google Analytics 4GA4_PROPERTY_ID + service account key
  • Google Search Console — service account key (see seo-audit-suite references)
  • Social platforms — same credentials as social-media-autopilot skill
  • SendGrid — for email delivery (SENDGRID_API_KEY)

Workspace

client-reports/
├── config.json           # Global settings, API keys
├── clients/              # Per-client configuration
│   └── client-name/
│       ├── config.json   # Client-specific settings (property IDs, branding)
│       ├── reports/      # Generated reports
│       └── data/         # Cached metrics data
├── templates/            # Report templates (Jinja2 HTML)
└── schedules.json        # Automated delivery schedule

Run scripts/init-workspace.sh to create this structure.

Core Workflows

1. Add a Client

scripts/add-client.sh --name "acme-corp" --domain "acme.com" --email "ceo@acme.com"

Creates client directory with config template. Edit clients/acme-corp/config.json to add:

  • GA4 property ID
  • Search Console site URL
  • Social media handles
  • Branding (logo URL, brand colors)
  • Report preferences (metrics to include, frequency)

2. Pull Metrics

Fetch fresh data for a client:

scripts/pull-metrics.sh --client "acme-corp"                    # All sources
scripts/pull-metrics.sh --client "acme-corp" --source ga4       # Google Analytics only
scripts/pull-metrics.sh --client "acme-corp" --source gsc       # Search Console only
scripts/pull-metrics.sh --client "acme-corp" --source social    # Social metrics
scripts/pull-metrics.sh --client "acme-corp" --period 30d       # Last 30 days

Data sources and metrics:

Google Analytics 4:

  • Sessions, users, new users, bounce rate
  • Top pages by views
  • Traffic sources breakdown
  • Conversion events
  • Device/browser breakdown

Google Search Console:

  • Total clicks, impressions, CTR, avg position
  • Top queries by clicks
  • Top pages by impressions
  • Position changes vs previous period

Social Media:

  • Followers/following changes
  • Post engagement (likes, shares, comments)
  • Top performing posts
  • Reach/impressions

3. Generate Reports

scripts/generate-report.sh --client "acme-corp" --type monthly
scripts/generate-report.sh --client "acme-corp" --type weekly --format html
scripts/generate-report.sh --client "acme-corp" --type custom --metrics "traffic,rankings,social"

Report types:

  • weekly — 7-day snapshot with week-over-week changes
  • monthly — 30-day deep dive with month-over-month trends
  • quarterly — 90-day strategic overview
  • custom — pick specific metrics

Output formats:

  • Markdown — default, good for Slack/email
  • HTML — branded, professional, email-ready
  • PDF — via HTML-to-PDF conversion (requires wkhtmltopdf or similar)

4. Auto-Deliver Reports

scripts/deliver-report.sh --client "acme-corp" --latest         # Send most recent
scripts/deliver-report.sh --client "acme-corp" --via email      # Email delivery
scripts/deliver-report.sh --client "acme-corp" --via slack      # Slack webhook

5. Schedule Recurring Reports

Configure in schedules.json:

{
  "schedules": [
    {
      "client": "acme-corp",
      "type": "weekly",
      "day": "monday",
      "time": "09:00",
      "timezone": "America/Los_Angeles",
      "deliver_via": "email",
      "enabled": true
    },
    {
      "client": "acme-corp",
      "type": "monthly",
      "day_of_month": 1,
      "time": "09:00",
      "timezone": "America/Los_Angeles",
      "deliver_via": "email",
      "enabled": true
    }
  ]
}

Use with OpenClaw cron to automate: check schedules daily, generate and deliver due reports.

6. KPI Dashboard

Quick terminal dashboard for any client:

scripts/dashboard.sh --client "acme-corp"

Shows current period vs previous: traffic, rankings, social growth, conversions.

Report Template System

Templates use Jinja2 and live in templates/:

<!-- templates/monthly.html -->
<html>
<head><style>/* brand styles */</style></head>
<body>
  <h1>Monthly Report — {{ client.name }}</h1>
  <p>{{ period.start }} to {{ period.end }}</p>
  
  <h2>Traffic Overview</h2>
  <table>
    <tr><td>Sessions</td><td>{{ ga4.sessions }}</td><td>{{ ga4.sessions_change }}%</td></tr>
    <tr><td>Users</td><td>{{ ga4.users }}</td><td>{{ ga4.users_change }}%</td></tr>
  </table>
  
  <h2>Search Performance</h2>
  <!-- ... -->
</body>
</html>

Customize templates per client by placing overrides in clients//templates/.

Cron Integration

  • Daily: Pull fresh metrics for all active clients
  • Weekly: Generate and deliver weekly reports (Monday AM)
  • Monthly: Generate and deliver monthly reports (1st of month)
  • Quarterly: Generate quarterly reviews

References

  • references/ga4-setup.md — Google Analytics 4 API setup and available metrics
  • references/report-customization.md — How to customize templates and metrics

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 13:49 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 199 📥 65,290
content-creation

Human Writing

reighlan
写作内容自然如人—无AI痕迹、无企业套话。适用于撰写、编辑或审阅任何面向发布的内容。
★ 6 📥 6,041
data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 166 📥 60,297