Documents

Google Analytics 4

Try it

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.

What it does

Query GA4 properties for analytics data: page views, sessions, users, traffic sources, conversions, and more.

The skill document

GA4 - Google Analytics 4 Data API

Query GA4 properties for analytics data: page views, sessions, users, traffic sources, conversions, and more.

Setup (one-time)

  1. Enable Google Analytics Data API: https://console.cloud.google.com/apis/library/analyticsdata.googleapis.com
  2. Create OAuth credentials or use existing Google Cloud project
  3. Set environment variables:
    • GA4_PROPERTY_ID - Your GA4 property ID (numeric, e.g., "123456789")
    • GOOGLE_CLIENT_ID - OAuth client ID
    • GOOGLE_CLIENT_SECRET - OAuth client secret
    • GOOGLE_REFRESH_TOKEN - OAuth refresh token (from initial auth flow)

Safety Boundaries

  • This skill only connects to Google Analytics Data API endpoints.
  • It does NOT write to or modify your GA4 property — read-only queries only.
  • It does NOT store or transmit credentials beyond the current session.
  • It requires OAuth credentials (client ID, secret, refresh token) set as environment variables.

Common Queries

Top Pages (by pageviews)

python3 scripts/ga4_query.py --metric screenPageViews --dimension pagePath --limit 30

Top Pages with Sessions & Users

python3 scripts/ga4_query.py --metrics screenPageViews,sessions,totalUsers --dimension pagePath --limit 20

Traffic Sources

python3 scripts/ga4_query.py --metric sessions --dimension sessionSource --limit 20

Landing Pages

python3 scripts/ga4_query.py --metric sessions --dimension landingPage --limit 30

Custom Date Range

python3 scripts/ga4_query.py --metric sessions --dimension pagePath --start 2026-01-01 --end 2026-01-15

Filter by Page Path

python3 scripts/ga4_query.py --metric screenPageViews --dimension pagePath --filter "pagePath=~/blog/"

Available Metrics

Common metrics: screenPageViews, sessions, totalUsers, newUsers, activeUsers, bounceRate, averageSessionDuration, conversions, eventCount

Available Dimensions

Common dimensions: pagePath, pageTitle, landingPage, sessionSource, sessionMedium, sessionCampaignName, country, city, deviceCategory, browser, date

Output Formats

Default: Table format Add --json for JSON output Add --csv for CSV output

Related skills

Fetch raw ad creative, app, ranking, and revenue data from AdMapix as structured JSON.

by fly0pants4.3k installs296 stars

Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.

by johnpatternai21 installs8 stars

Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.

by Iván855 installs69 stars

Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.

by Iván558 installs18 stars

More from jdrhyne

Browse all skills

Natural-language Jira interaction that reads, drafts, creates, and updates issues.

by Jonathan Rhyne311 installs16 stars

Reconstruct missing conversation context after compaction or truncation using channel and session APIs.

by jdrhyne207 installs3 stars

Query and audit Google Ads accounts via browser automation or the Google Ads API, including keyword pauses.

by jdrhyne257 installs14 stars

Query Google Search Console data from the CLI for search analytics and indexing checks.

by jdrhyne252 installs23 stars

Upload documents to Nudocs.ai for rich editing and pull back the results as docx, md, or pdf.

by jdrhyne92 installs1 stars

Convert, OCR, extract, redact, watermark, and sign PDF and Office documents inside OpenClaw via the Nutrient DWS plugin.

by jdrhyne125 installs4 stars