Query Google Analytics 4 (GA4) data via the Analytics Data API. Use when you need to pull website analytics like top pages, traffic sources, user counts, sessions, conversions, or any GA4 metrics/dimensions. Supports custom date ranges and filtering.
74
93%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Query GA4 properties for analytics data: page views, sessions, users, traffic sources, conversions, and more.
GA4_PROPERTY_ID - Your GA4 property ID (numeric, e.g., "123456789")GOOGLE_CLIENT_ID - OAuth client IDGOOGLE_CLIENT_SECRET - OAuth client secretGOOGLE_REFRESH_TOKEN - OAuth refresh token (from initial auth flow)python3 scripts/ga4_query.py --metric screenPageViews --dimension pagePath --limit 30python3 scripts/ga4_query.py --metrics screenPageViews,sessions,totalUsers --dimension pagePath --limit 20python3 scripts/ga4_query.py --metric sessions --dimension sessionSource --limit 20python3 scripts/ga4_query.py --metric sessions --dimension landingPage --limit 30python3 scripts/ga4_query.py --metric sessions --dimension pagePath --start 2026-01-01 --end 2026-01-15python3 scripts/ga4_query.py --metric screenPageViews --dimension pagePath --filter "pagePath=~/blog/"Common metrics: screenPageViews, sessions, totalUsers, newUsers, activeUsers, bounceRate, averageSessionDuration, conversions, eventCount
Common dimensions: pagePath, pageTitle, landingPage, sessionSource, sessionMedium, sessionCampaignName, country, city, deviceCategory, browser, date
Default: Table format
Add --json for JSON output
Add --csv for CSV output