google-analytics-data-api-basics
方便将 GA 数据整合到仪表盘或自动化报表流程,节省分析人力。
需启用 API 并配置凭据,涉及访问用户/产品数据权限和隐私合规。
使用 Google Analytics Data API(v1beta)查询和生成定制化分析报告与指标。
帮你开启并用 Google Analytics Data API v1beta 拉取定制化分析报表,能查询像 activeUsers、screenPageViews 之类的指标和 city、date 等维度。需要把 GA 数据接入自动化报表、做定制化查询或验证 API 是否启用时会用到。不要用它来做 Admin 操作(建 property 或管理用户)或前端埋点安装,它专注于报表数据层。
▸ 展开 SKILL.md 英文原文
Manages Google Analytics reporting data, enables the Analytics Data API via the Cloud CLI, and creates reports using the Google Analytics Data API (v1beta). Use when you need to interact with Google Analytics properties, run customized analytics reports, query metrics (like activeUsers, screenPageViews) and dimensions (like city, date), check metrics and dimensions compatibility, or verify API enablement. Don't use for Google Analytics Admin API operations (e.g., creating properties, managing users) or for front-end tracking installation.
帮我安装这个 skill:https://raw.githubusercontent.com/google/skills/main/skills/analytics/google-analytics-data-api-basics/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/google/skills/main/skills/analytics/google-analytics-data-api-basics/SKILL.md"# Getting Started with Google Analytics Data API
The Google Analytics Data API v1beta provides programmatic access to Google
Analytics report data. It allows you to build customized dashboards,
automate reporting workflows, and integrate Google Analytics data into your enterprise
applications.
## Enabling the API via Cloud CLI
Before making API calls, ensure the Google Analytics Data API is enabled in your
Google Cloud project.
If `gcloud` is not found, prompt the user to install the Google Cloud CLI before
running these commands.
1. **Enable the API:** Use the Cloud CLI (`gcloud`) to enable
`analyticsdata.googleapis.com`.
```bash
gcloud services enable analyticsdata.googl