Ga4
by openclaw
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.
Skill Details
Repository Files
4 files in this skill directory
name: ga4 description: 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. metadata: {"clawdbot":{"emoji":"📊","requires":{"bins":["python3"]}}}
GA4 - Google Analytics 4 Data API
Query GA4 properties for analytics data: page views, sessions, users, traffic sources, conversions, and more.
Setup (one-time)
- Enable Google Analytics Data API: https://console.cloud.google.com/apis/library/analyticsdata.googleapis.com
- Create OAuth credentials or use existing Google Cloud project
- Set environment variables:
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)
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
Xlsx
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
Clickhouse Io
ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.
Clickhouse Io
ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.
Analyzing Financial Statements
This skill calculates key financial ratios and metrics from financial statement data for investment analysis
Data Storytelling
Transform data into compelling narratives using visualization, context, and persuasive structure. Use when presenting analytics to stakeholders, creating data reports, or building executive presentations.
Kpi Dashboard Design
Design effective KPI dashboards with metrics selection, visualization best practices, and real-time monitoring patterns. Use when building business dashboards, selecting metrics, or designing data visualization layouts.
Dbt Transformation Patterns
Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.
Sql Optimization Patterns
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.
Anndata
This skill should be used when working with annotated data matrices in Python, particularly for single-cell genomics analysis, managing experimental measurements with metadata, or handling large-scale biological datasets. Use when tasks involve AnnData objects, h5ad files, single-cell RNA-seq data, or integration with scanpy/scverse tools.
Xlsx
Spreadsheet toolkit (.xlsx/.csv). Create/edit with formulas/formatting, analyze data, visualization, recalculate formulas, for spreadsheet processing and analysis.
