google-analytics

SkillWeb & browsing

Once this is added, your AI can answer questions about your website using your Google Analytics 4 data. It can pull reports on traffic, sessions, users, top pages, traffic sources, and conversions, and it can show what is happening on your site right now. It can also list the Google Analytics properties in your account.

Available today. Use it from your connected AI after setup.

After adding it, ask your AI for the numbers you care about, such as your top pages this month or how many users visited today. If you are not sure which property to use, ask it to list your properties first.

Then ask your AI: use the google-analytics skill

What your AI can do with it

  • Pull Google Analytics 4 reports on website traffic, sessions, and users
  • Show your top pages and where visitors come from
  • Report on conversions
  • Show a realtime report of current site activity
  • List the Google Analytics properties in your account

What this skill tells your AI

The instructions your AI receives, as published by kwakseongjae/oh-my-design in .agents/skills/google-analytics/SKILL.md and read by ahel’s review.

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.

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

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

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.

Signals

GitHub stars
500
Forks
45
Last commit
Sep 2026

ahel review

  • S4info
    community integration — published by kwakseongjae, not google

Automated review, not a security audit. Ruleset v1.

Advanced
Catalog kind
skill
Gateway key
google-analytics
Source
github.com/kwakseongjae/oh-my-design