LaunchKit · 2026
Back to Skills

native-google-analytics

Query Google Analytics 4 (GA4) data directly via the Analytics Data API.

18
390 downloads
by @codeninja23

Setup & Installation

openclaw skills install @codeninja23/native-google-analytics

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install native-google-analytics

Version History

v0.1.1Feb 22, 2026 - Version note by skill developer:

- Added new metadata section to SKILL.md for environment variables, binaries, and file requirements. - Declared primary environment variable (GA4_PROPERTY_ID) and listed required scripts for openclaw compatibility. - Added a README.md file. - No changes to core functionality.

What This Skill Does

Queries Google Analytics 4 data directly via the Analytics Data API. Supports metrics like pageviews, sessions, users, bounce rate, and conversions across custom date ranges, dimensions, and filters. Calls the API directly without a third-party proxy.

Queries GA4 directly via the official API without requiring the Analytics UI or a third-party data connector.

When to use it

  • Check which blog posts got the most traffic last month
  • Compare sessions by traffic source after a campaign launch
  • Find landing pages with high bounce rates
  • Break down visitors by country or device type
  • Pull conversion data by campaign name for a report

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: What were my top 10 pages by pageviews this January?

AGENT
  1. 1Reads GA4_PROPERTY_ID from environment
  2. 2Calls ga4_query.py with --metrics screenPageViews --dimension pagePath --start 2026-01-01 --end 2026-01-31 --limit 10
  3. 3Authenticates using GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, and GOOGLE_REFRESH_TOKEN
  4. 4Sends request to analyticsdata.googleapis.com
  5. 5Returns formatted table of pages and their pageview counts
OUTPUT

A ranked table of page paths with pageview totals for January 2026

Requirements

Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.

Google Cloud project with Analytics Data API enabledOAuth 2.0 client credentials (Client ID and Client Secret) from Google Cloud ConsoleGA4 property ID from Google Analytics Admin settingsOAuth refresh token generated via local browser login flowgoogle-auth-oauthlib Python package installed