google-analytics
/google-analytics
Query Google Analytics 4 (GA4) reports via the Analytics Data API v1 and list properties via the Admin API. Use when the user mentions Google Analytics, GA4, website traffic / sessions / users, top pages or sources, conversions, or a realtime report.
- Author
- AceDataCloud ↗
- Repository
- Skills ↗
- Licence
- Apache-2.0
- Last repository change
- 25.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 3
No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
Query Google Analytics 4 (GA4) reports via the Analytics Data API v1 and list properties via the Admin API. Use when the user mentions Google Analytics, GA4, website traffic / sessions / users, top pages or sources, conversions, or a realtime report.
Original author description
Query Google Analytics 4 (GA4) reports via the Analytics Data API v1 and list properties via the Admin API. Use when the user mentions Google Analytics, GA4, website traffic / sessions / users, top pages or sources, conversions, or a realtime report.
How it works
- Run a report
- Realtime
- Gotchas
SKILL.md preview
---
name: google-analytics
description: Query Google Analytics 4 (GA4) reports via the Analytics Data API v1 and list properties via the Admin API. Use when the user mentions Google Analytics, GA4, website traffic / sessions / users, top pages or sources, conversions, or a realtime report.
when_to_use: |
Trigger when the user wants GA4 metrics — sessions, users, top
pages / channels / countries, conversions, or live realtime users —
for one of their GA4 properties. Read-only (`analytics.readonly`).
List properties first to get the numeric property id.
connections: [google/analytics]
allowed_tools: [Bash]
license: Apache-2.0
metadata:
author: acedatacloud
version: "1.0"
---
Query **Google Analytics 4** via `curl + jq`. The user's OAuth bearer token is in
`$GOOGLE_ANALYTICS_TOKEN` (scope `analytics.readonly`); every call needs
`Authorization: Bearer $GOOGLE_ANALYTICS_TOKEN`. Two APIs: the **Admin API**
(`analyticsadmin.googleapis.com/v1beta`) to discover properties, and the **Data
API** (`analyticsdata.googleapis.com/v1beta`) to run reports.
Failures are `{"error":{"code","message","status"}}` — show verbatim. `401` =
re-install.
```bash
AUTH="Authorization: Bearer $GOOGLE_ANALYTICS_TOKEN"
# List the GA4 properties the user can access (via their account summaries)
curl -sS -H "$AUTH" "https://analyticsadmin.googleapis.com/v1beta/accountSummaries" \
| jq '.accountSummaries[]?.propertySummaries[]? | {property, displayName}'
```
`property` looks like `properties/123456789` — the number is the `PROPERTY_ID`.
## Run a report
```bash
PID="123456789"
curl -sS -X POST -H "$AUTH" -H "Content-Type: application/json" -d '{
"dateRanges":[{"startDate":"28daysAgo","endDate":"today"}],
"dimensions":[{"name":"pagePath"}],
"metrics":[{"name":"screenPageViews"},{"name":"activeUsers"}],
"orderBys":[{"metric":{"metricName":"screenPageViews"},"desc":true}],
"limit":10
}' "https://analyticsdata.googleapis.com/v1beta/properties/$PID:runReport" \
| jq '.rows[] | {page: .dimensionValues[0].value, views: .metricValues[0].value, users: .metricValues[1].value}'
```
Swap dimensions/metrics for other reports: `sessionDefaultChannelGroup` +
`sessions` (acquisition), `country` + `activeUsers` (geo), `eventName` +
`eventCount` / `conversions` (events). Dates accept `NdaysAgo`, `today`,
`yesterday`, or `YYYY-MM-DD`.
## Realtime
```bash
curl -sS -X POST -H "$AUTH" -H "Content-Type: application/json" \
-d '{"dimensions":[{"name":"country"}],"metrics":[{"name":"activeUsers"}]}' \
"https://analyticsdata.googleapis.com/v1beta/properties/$PID:runRealtimeReport" | jq '.rows'
```
## Gotchas
- This is **GA4 only** (Data API v1). Old Universal Analytics (UA) is shut down —
don't use the legacy `analytics/v3` endpoints.
- Valid dimension/metric API names matter (`screenPageViews`, not "Pageviews").
If a name 400s, it's the wrong API id — check the GA4 dimensions & metrics list.
- Reports are capped by `limit` (default 10k rows); page with `offset`.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · AceDataCloud/Skills | 100 | Apache-2.0 |
| vibe-md/vibe.md | 100 | MIT |
| superdesigndev/treg | 100 | Apache-2.0 |
| davila7/claude-code-templates | 100 | MIT |
| OpenClaudia/openclaudia-skills | 100 | MIT |
| fabiensalles/claude-marketplace | 100 | MIT |
| henkisdabro/wookstar-claude-plugins | 100 | MIT |
| lichamnesia/lich-skills | 100 | MIT |
Identical content appears in 1 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version ea8a513910e9 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100google-analytics-data-api-basics
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… - 95google-analytics-cli
Google Analytics 4 data analysis and reporting via google-analytics-cli. Use when the user wants to check GA4 traffic, run reports with dimensions and metrics, monitor realtime users, explore account structure, or analyze user behavior. Triggers: "Google Analytics", "GA4",… - 100google-analytics-admin-api-basics
Manages Google Analytics account and property settings, enables the Analytics Admin API via the Cloud CLI, lists accounts and properties, and manages data streams, custom dimensions, conversion events, and integrations. Use when you need to programmatically configure Google… - 100google-analytics-data-api-basics
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… - 90google-analytics-tool
When the user wants traffic data, conversion tracking, user behavior on location pages, GBP traffic attribution, or geographic traffic patterns. Trigger on "Google Analytics," "GA4," "traffic," "conversions," "how many leads," "phone calls," "form submissions," "where is my… - 100ga4
Read Google Analytics 4 reporting data through the GA4 Data API. Use for explicit GA4 property metadata, compatible metric/dimension reports, traffic analysis, key events, quotas, and bounded exports.