首页龙虾技能列表 › GA4 Connector

GA4 Connector

v0.1.1

Query Google Analytics 4 (GA4) data through the Google Analytics Data API for trends, countries, sources, pages, and conversion analysis. Use when a user wan...

1· 193·0 当前·0 累计
by @nanaco666 (nanaco)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/12
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill's code and instructions match its GA4 Data API purpose: it uses OAuth user authorization, installs Google client libs, and stores a client JSON and OAuth token under ~/.config/openclaw — nothing in the bundle looks disproportionate or unrelated to querying GA4.
评估建议
This skill appears to do what it says (connect to GA4 via the Google Analytics Data API). Before installing, review and consider: 1) The installer will copy your Desktop OAuth client JSON into ~/.config/openclaw and create an OAuth token at ~/.config/openclaw/ga4-token.json — both grant access to GA data and should be kept private. 2) The installer will add an export GA4_PROPERTY_ID line to your shell rc (~/.bashrc or ~/.zshrc); back up that file first and inspect the change if you don't want en...
详细分析 ▾
用途与能力
Name/description claim GA4 Data API access; included scripts implement OAuth InstalledAppFlow, call the google.analytics.data client, and provide query examples. Required behaviors (client secret, token cache, property ID) are all appropriate for the stated purpose.
指令范围
SKILL.md and scripts are focused on GA4 setup and queries. They instruct installing Python packages, copying the OAuth client JSON to ~/.config/openclaw, running an OAuth browser flow, and storing the token at ~/.config/openclaw/ga4-token.json. Those actions are within the expected scope but are persistent filesystem and shell-config changes (see persistence).
安装机制
No external arbitrary downloads; install script uses `python3 -m pip install --user` for well-known google-auth and analytics packages. No archives or remote executables are fetched from untrusted URLs. This is a typical, low-risk install path for a Python-based connector.
凭证需求
The repository metadata lists no required env vars, but the code accepts GA4_PROPERTY_ID via env/argument and the installer writes `export GA4_PROPERTY_ID=...` into the user's shell rc. The skill requires and persists the client secret JSON and OAuth token locally — these are sensitive and should be treated like credentials. This request is proportional to its function, but users must protect those files.
持久化与权限
The skill is not always-enabled and does not request elevated system privileges. It does modify the user's shell rc to export GA4_PROPERTY_ID and writes files to ~/.config/openclaw (client secret and token) and installs Python packages to the user site. Those are expected for this connector but are persistent changes the user should review before running.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv0.1.12026/3/12

- Renamed the skill from "ga4-data-api" to "ga4-connector". - No changes to functionality, documentation, or setup instructions.

● 无害

安装命令 点击复制

官方npx clawhub@latest install ga4-connector
镜像加速npx clawhub@latest install ga4-connector --registry https://cn.clawhub-mirror.com

技能文档

Use this skill to set up and query GA4 through OAuth user authorization.

Default approach

Prefer OAuth user authorization first.

Use scripts/install_ga4_openclaw.sh + scripts/ga4_query.py for the normal path.

Only suggest service accounts later, when there is a clear need for headless/server-side access.

Hard rules

  • Check account + permission before setup
- Ask which Google account can actually log into GA and has property/account access. - Do not start with service-account setup by default for enterprise/internal data.

  • Be honest about blockers
- If the user cannot add users, say it is a permission blocker. - If the OAuth app is still in Testing, say the account must be added to test users. - If the user can see the property but lacks admin controls, say it is an access-level issue instead of pretending the button is hidden.

Setup flow

Step 1 — Verify access model

Ask/confirm:

  • Which Google account has GA access?
  • Can the user log into that account?
  • What is the GA4 Property ID?
  • Is Google Analytics Data API already enabled?
  • Is there already a Desktop OAuth client JSON?

Step 2 — Install and wire credentials

Run:

bash ~/.openclaw/workspace/skills/ga4-data-api/scripts/install_ga4_openclaw.sh  

This installs Python deps, copies the OAuth client JSON into ~/.config/openclaw/ga4-client.json, and writes GA4_PROPERTY_ID into shell config.

Step 3 — First authorization

Run:

python3 ~/.openclaw/workspace/skills/ga4-data-api/scripts/ga4_query.py \
  --metrics activeUsers,sessions \
  --dimensions date \
  --start 7daysAgo \
  --end today \
  --pretty

The browser will open. The user must choose the same Google account that actually has GA access.

Successful authorization creates:

  • ~/.config/openclaw/ga4-token.json

Step 4 — Query examples

Recent trend:

python3 ~/.openclaw/workspace/skills/ga4-data-api/scripts/ga4_query.py \
  --metrics activeUsers,sessions \
  --dimensions date \
  --start 7daysAgo \
  --end yesterday \
  --pretty

Country split:

python3 ~/.openclaw/workspace/skills/ga4-data-api/scripts/ga4_query.py \
  --metrics activeUsers \
  --dimensions country \
  --start 7daysAgo \
  --end yesterday \
  --limit 50 \
  --pretty

Source split:

python3 ~/.openclaw/workspace/skills/ga4-data-api/scripts/ga4_query.py \
  --metrics sessions \
  --dimensions sessionSourceMedium \
  --start 7daysAgo \
  --end yesterday \
  --limit 50 \
  --pretty

Analysis guidance

For trend questions:

  • Prefer full days (end=yesterday) unless the user explicitly wants intraday.
  • Call out whether a same-day drop is just partial-day data.

For conversion questions:

  • Separate traffic events from true conversion events.
  • If key events look too broad, recommend narrowing the event set before drawing product conclusions.

References

  • Read references/setup.md when the user needs the shareable setup process.
  • Use scripts/ga4_query.py instead of hand-writing fresh GA SDK samples each time.
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务