Google Analytics CLI for Openclaw

A powerful command-line interface for Google Analytics 4 providing deep access to reporting, realtime data, and property management.

bin-huang
v1.0.0
Apr 7, 2026
0
871
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install google-analytics-cli

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install google-analytics-cli using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Google Analytics CLI?

The Google Analytics CLI skill enables developers and analysts to interact with GA4 properties directly from their terminal. By leveraging Openclaw Skills, users can bypass complex web UIs to run high-performance reports, explore account structures, and monitor active user behavior using structured commands. This skill focuses on read-only access, ensuring data integrity while providing the flexibility of the GA4 Data and Admin APIs through a streamlined interface.

This tool is particularly valuable for those who need to integrate analytics data into automated workflows or perform rapid ad-hoc analysis without leaving the development environment. Whether you are checking traffic sources or auditing conversion events, this skill provides the technical depth required for modern data-driven decision making via Openclaw Skills.

Google Analytics CLI Use Cases

  • Monitoring active users and realtime site activity across properties.
  • Generating automated traffic, engagement, and ecommerce performance reports.
  • Auditing property access, data retention settings, and account change history.
  • Comparing performance metrics across different date ranges to identify trends.
  • Exporting specific audience data for external marketing workflows using Openclaw Skills.

How Google Analytics CLI Works

  1. The user identifies the target GA4 Property ID and authenticates using Google service account credentials.
  2. Commands are issued to the CLI to query specific dimensions (like pagePath) and metrics (like activeUsers).
  3. The skill translates these commands into requests for the GA4 Data API or Admin API.
  4. Filters and sorting logic are applied using JSON-formatted expressions to refine the dataset.
  5. The tool returns structured JSON output, which can be visualized or piped into other processes within Openclaw Skills.
  6. For long-running tasks like audience exports, the skill provides polling mechanisms to track and retrieve completed data.

Google Analytics CLI Setup

Prerequisites

Install the CLI globally using npm and ensure you have a Google Cloud service account with Viewer access to your GA4 property.

npm install -g google-analytics-cli

Authentication

Place your service account credentials.json in ~/.config/google-analytics-cli/ or set the environment variable:

export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/credentials.json"

Verification

Confirm access by listing your available accounts and properties:

google-analytics-cli accounts

Google Analytics CLI Data Schema & Taxonomy

The skill organizes its data interaction based on the GA4 API schema. All outputs are delivered as JSON objects. Key components of the data taxonomy include:

Component Type Description
Dimensions String Categorical attributes (e.g., country, browser, sessionSource).
Metrics Numeric Quantitative measurements (e.g., sessions, totalRevenue, eventCount).
Date Ranges Array Support for up to 4 ranges using relative (30daysAgo) or absolute (YYYY-MM-DD) formats.
Filters JSON Complex filtering logic including andGroup, orGroup, and notExpression.
Property Quota Metadata Realtime tracking of API token consumption to prevent rate limiting in Openclaw Skills.

Google Analytics CLI Advanced Features

  • Pivot Reports: Perform complex cross-tabulation analysis of multiple dimensions and metrics.
  • Batch Reporting: Execute up to 5 distinct report requests in a single API call for increased efficiency.
  • Audience Exports: Create and query granular exports for specific user segments and device IDs.
  • Compatibility Checking: Verify if specific dimension and metric combinations are valid before running large reports.
  • Realtime Monitoring: Access a specialized subset of dimensions and metrics to see site activity from the last 30 minutes via Openclaw Skills.
  • Administrative Auditing: Inspect Google Ads links, custom dimensions, and key event configurations directly.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*