ServicesAboutNotesContact Get in touch →
EN FR
Note

OpenClaw GA4 Skill Integration

How to use community GA4 skills from ClawHub to pull analytics metrics into OpenClaw — the two main options, what each extracts, and how to feed the output into scheduled reporting.

Planted
ga4analyticsautomationai

Two community-built GA4 skills on ClawHub cover the most common GA4 reporting needs for scheduled workflows. Both are community-maintained and carry the tradeoffs associated with unvetted community skills.

The Two Options

jdrhyne/ga4

Jonathan Rhyne built this skill “in roughly 20 minutes.” It covers the core GA4 Data API endpoints: page views, sessions, users, traffic sources, and conversion events. Date ranges and basic filtering are supported.

Install it:

Terminal window
openclaw skill add jdrhyne/ga4

Prerequisites: Python 3, OAuth credentials for the GA4 Data API, and a GA4_PROPERTY_ID environment variable. If you’ve worked with the GA4 API before, the credential setup is the same OAuth consent screen process you’ve seen before. If you haven’t, budget 20-30 minutes of Google Cloud Console configuration — service account creation, enabling the API, configuring the OAuth consent screen, downloading credentials.

This skill covers the basics well. For simple weekly reporting that needs session counts, conversion rates, and traffic source breakdowns, it does the job.

adamkristopher/ga4-analytics

A more comprehensive version that bundles GA4 with Search Console and the Indexing API. It exposes 30+ API functions, auto-saves timestamped JSON results locally, and generates Markdown summaries with tables, trends, and recommendations.

The auto-generated Markdown summaries include tables for top pages, percentage-change columns for week-over-week trends, and an interpretation of notable shifts. The JSON output provides structured data for downstream formatting when the Markdown doesn’t match a specific template. The local JSON archive creates a record of each week’s numbers for historical lookups.

What a GA4 Reporting Cron Job Extracts

With either skill, the weekly extraction covers:

Session trends — total sessions this week vs. last week with a percentage change. This is the headline number most clients care about first.

Top pages — the 10 highest-traffic pages and their week-over-week changes. Directional changes (growing, declining, flat) are usually more useful than absolute numbers.

Traffic source breakdown — organic, paid, direct, and referral, with week-over-week shifts. For clients running campaigns, the paid vs. organic split often tells the most important story.

Conversion rates — goal completions, ecommerce transactions, or whatever conversion events the client has configured. The GA4 Data API returns whatever conversion events are marked in the property; your cron message should specify which ones to surface.

These four data points cover the weekly check-in for most clients without requiring any custom event setup or complex query logic.

The Setup Pattern

A working GA4 cron job needs three things beyond the skill installation:

OAuth credentials in the environment. The GA4 Data API uses OAuth, not a simple API key. You need GOOGLE_APPLICATION_CREDENTIALS pointing to a service account JSON file (for server-side use) or a valid OAuth token for a user account. Service accounts are cleaner for scheduled jobs — they don’t expire, and you can manage them programmatically.

Property ID as an environment variable. Each GA4 property has a numeric ID (not the measurement ID — the property ID visible in the GA4 admin interface under “Property settings”). Set GA4_PROPERTY_ID per client, or pass it as part of the cron message if you’re managing multiple properties.

A clear date range instruction. The skill defaults to sensible ranges, but for weekly reporting you want explicit dates. Either instruct the cron message to use “the past 7 days ending yesterday” or configure the skill to calculate the previous full week (Monday-Sunday).

For a multi-client setup where each client has a different GA4 property, the cleanest approach is separate cron jobs per client, each with its own environment configuration. See Multi-Client Agent Reporting Architecture for how to structure per-client credential and cron job isolation.

The ClawHub Quality Caveat

Both skills are community-maintained, which means they have no official support contract and may not be updated if the GA4 API changes. The GA4 Data API has been relatively stable, but Google’s track record on API stability — especially for analytics products — warrants healthy skepticism.

Before installing either skill in a setup that handles real client data, read the skill’s repository for recent commit history. A skill that hasn’t been touched in a year is more likely to hit an API change without warning. The Dutch Data Protection Authority’s estimate that roughly 20% of ClawHub skills contain malware is a separate concern — see OpenClaw Security Risks — What’s Documented for the full picture there.

The short-version operational rule: review the skill’s source code before installation, install from a pinned version if the registry supports it, and run community skills in a sandboxed environment before giving them access to production client credentials.

GA4 vs. BigQuery Export for Reporting

For clients with the GA4 BigQuery export enabled, pulling data directly from BigQuery is often more reliable than the GA4 Data API. The BigQuery export gives you the raw event tables, which means:

  • No sampling (the GA4 API samples large queries)
  • Exact numbers that match what you’d calculate from raw data
  • Access to custom parameters not exposed through the standard API

The tradeoff is SQL: you need to write the queries that calculate your KPIs from the raw events, which requires knowing the GA4 event schema and unnesting patterns. The Data API does this for you automatically. For clients where the numbers need to exactly match manually-run reports, BigQuery is the right choice. For quick weekly summaries where approximate numbers are fine, the GA4 skill is faster to set up.

See KPI Reporting via Direct Warehouse Queries for the BigQuery approach when exact numbers matter.