google-analytics by davila7/claude-code-templates
npx skills add https://github.com/davila7/claude-code-templates --skill google-analytics利用 Google Analytics 数据来分析网站性能,提供可操作的见解和改进建议。
此技能需要 Google Analytics API 凭据。请设置环境变量:
export GOOGLE_ANALYTICS_PROPERTY_ID="your-property-id"
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"
或在项目根目录创建 .env 文件:
GOOGLE_ANALYTICS_PROPERTY_ID=123456789
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
切勿将凭据提交到版本控制系统。 服务账户 JSON 文件应安全地存储在您的代码仓库之外。
# 选项 1:从 requirements 文件安装(推荐)
pip install -r cli-tool/components/skills/analytics/google-analytics/requirements.txt
# 选项 2:单独安装
pip install google-analytics-data python-dotenv pandas
配置完成后,我可以:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
向我提问,例如:
当您要求我分析 Google Analytics 数据时,我将:
有关详细的指标定义和维度,请参阅 REFERENCE.md。
完整的分析模式和用例,请参阅 EXAMPLES.md。
此技能包含用于 API 交互的实用脚本:
python scripts/ga_client.py --days 30 --metrics sessions,users,bounceRate
python scripts/analyze.py --period last-30-days --compare previous-period
这些脚本处理 API 身份验证、数据获取和基本分析。我将解释结果并提供可操作的建议。
身份验证错误:请验证:
GOOGLE_APPLICATION_CREDENTIALS 指向有效的服务账户 JSON 文件GOOGLE_ANALYTICS_PROPERTY_ID 与您的 GA4 资源 ID 匹配(不是衡量 ID)未返回数据:请检查:
导入错误:安装所需包:
pip install google-analytics-data python-dotenv pandas
.env 文件进行配置.env 和凭据文件添加到 .gitignore此技能仅访问聚合的分析数据。它不会:
所有数据均在本地处理,仅用于在对话期间生成建议。
每周安装数
366
代码仓库
GitHub 星标数
22.6K
首次出现
Jan 21, 2026
安全审计
安装于
opencode296
gemini-cli288
codex268
claude-code265
cursor250
github-copilot247
Analyze website performance using Google Analytics data to provide actionable insights and improvement recommendations.
This Skill requires Google Analytics API credentials. Set up environment variables:
export GOOGLE_ANALYTICS_PROPERTY_ID="your-property-id"
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"
Or create a .env file in your project root:
GOOGLE_ANALYTICS_PROPERTY_ID=123456789
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
Never commit credentials to version control. The service account JSON file should be stored securely outside your repository.
# Option 1: Install from requirements file (recommended)
pip install -r cli-tool/components/skills/analytics/google-analytics/requirements.txt
# Option 2: Install individually
pip install google-analytics-data python-dotenv pandas
Once configured, I can:
Ask me questions like:
When you ask me to analyze Google Analytics data, I will:
For detailed metric definitions and dimensions, see REFERENCE.md.
For complete analysis patterns and use cases, see EXAMPLES.md.
The Skill includes utility scripts for API interaction:
python scripts/ga_client.py --days 30 --metrics sessions,users,bounceRate
python scripts/analyze.py --period last-30-days --compare previous-period
The scripts handle API authentication, data fetching, and basic analysis. I'll interpret the results and provide actionable recommendations.
Authentication Error : Verify that:
GOOGLE_APPLICATION_CREDENTIALS points to a valid service account JSON fileGOOGLE_ANALYTICS_PROPERTY_ID matches your GA4 property ID (not the measurement ID)No Data Returned : Check that:
Import Errors : Install required packages:
pip install google-analytics-data python-dotenv pandas
.env files for configuration.env and credential files to .gitignoreThis Skill accesses aggregated analytics data only. It does not:
All data is processed locally and used only to generate recommendations during the conversation.
Weekly Installs
366
Repository
GitHub Stars
22.6K
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
opencode296
gemini-cli288
codex268
claude-code265
cursor250
github-copilot247
DOCX文件创建、编辑与分析完整指南 - 使用docx-js、Pandoc和Python脚本
41,800 周安装
Gemini CLI 更新日志自动化流程指南 | 技术文档版本管理最佳实践
430 周安装
tsdown - 基于Rolldown的极速TypeScript/JavaScript库打包工具,支持ESM/CJS/IIFE/UMD
430 周安装
PDF OCR技能:双引擎文字提取,支持影印PDF和图片识别
430 周安装
MUI v7 使用指南:组件样式、主题定制与响应式设计模式详解
431 周安装
HubSpot CRM 集成指南:使用 Membrane CLI 自动化销售、营销与客户服务
431 周安装
index-knowledge:自动生成层级化AGENTS.md文档工具,Turso数据库出品
431 周安装