Skip to content
Agentmart
Submit a tool

google-analytics

Query Google Analytics 4 (GA4) reports via the Analytics Data API v1 and list properties via the Admin API.

Skill by acedatacloud

IndexedApache-2.0★ 17
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/acedatacloud-google-analytics

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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.

Use cases: documents, backend, data

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/google-analytics

What's inside

Skill 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.
License
Apache-2.0
Metadata
author: acedatacloud · version: 1.0
Instructions
54 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Files (1)

  • SKILL.md

SKILL.md (first lines)

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`.

From AceDataCloud/Skills, Apache-2.0.

More from AceDataCloud/Skills

Signals

Stars
17
Forks
1
Open issues
0
Last commit (this folder)
Jun 22, 2026 (4 months ago)
Last release
Oct 23, 2026 (5 days ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
1.0
License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from acedatacloud

Cite this page

google-analytics skill. Agent Mart. https://agentmart.dev/skills/acedatacloud-google-analytics (last updated 2026-10-24)