ga4-api

ga4-api is a skill for Claude Code, Codex from Buzzmatic/awesome-agent-skills. It costs 67 tokens per session (1,322 once invoked), scanned A, original, MIT.

A tool for retrieving Google Analytics 4 data through Google's reporting interface. Google Analytics 4 is a service that measures website or app visits, user activity, and conversions.

In plain words
What is it for?
Fetching traffic, conversion, user-behavior, engagement, realtime, pivot, batch, and funnel reports, with results saved as JSON and CSV files.
Why use it?
It lets an agent request structured reports for selected dates, metrics, dimensions, filters, properties, and comparison periods.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Fetching traffic, conversion, user-behavior, engagement, realtime, pivot, batch, and funnel reports, with results saved as JSON and CSV files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/buzzmatic/awesome-agent-skills/ga4-api
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Buzzmatic/awesome-agent-skills --skill ga4-api
Clone the repo
git clone --depth 1 https://github.com/Buzzmatic/awesome-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ga4-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/buzzmatic/awesome-agent-skills/ga4-api.svg)](https://agentmods.dev/skills/buzzmatic/awesome-agent-skills/ga4-api)
Your own site
<a href="https://agentmods.dev/skills/buzzmatic/awesome-agent-skills/ga4-api"><img src="https://agentmods.dev/badge/skills/buzzmatic/awesome-agent-skills/ga4-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,322 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00067 $0.01322
Opus 5 $0.00034 $0.00661
Sonnet 5 $0.00013 $0.00264
Haiku 4.5 $0.00007 $0.00132

Measured 7d ago against content hash 98a581aad3c4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

ga4-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

The scan reads SKILL.md. This mod also ships 10 executable files (scripts/auth.py, scripts/batch_reports.py, scripts/funnel_report.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ga4-api/SKILL.md · 201 lines

How it starts

The opening of the file, as written. The whole thing — 201 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Google Analytics 4 Data API Skill

Fetch and process data from the GA4 Data API v1.

Quick Start

All scripts:

  • Save raw JSON and processed CSV to ./output/ (override with --output-dir)
  • Return JSON with {"output_files": [...], "summary": "..."}

Core Operations

Standard Reports

Fetch GA4 data with flexible dimensions and metrics:

python skills/ga4-api/scripts/run_report.py \
  --property-id 123456789 \
  --start-date 2025-01-01 \
  --end-date 2025-01-07 \
  --dimensions date,sessionSource,sessionMedium \
  --metrics sessions,totalUsers,conversions \
  --row-limit 10000

Common dimension combinations:

  • date - Daily trends
  • sessionSource,sessionMedium - Traffic sources
  • pagePath - Top pages
  • country,city - Geographic breakdown
  • deviceCategory - Device types
  • eventName - Event analysis

Optional filters:

--dimension-filter 'country equals US' \
--metric-filter 'sessions greaterThan 100'

Date range comparison:

--compare-start 2024-12-25 \
--compare-end 2024-12-31

Batch Reports

Run multiple reports in a single API call:

python skills/ga4-api/scripts/batch_reports.py \
  --property-id 123456789 \
  --config-file reports_config.json

Config file format:

{
  "date_range": {"start": "2025-01-01", "end": "2025-01-07"},
  "reports": [
    {"name": "traffic_sources", "dimensions": ["sessionSource"], "metrics": ["sessions", "totalUsers"]},
    {"name": "top_pages", "dimensions": ["pagePath"], "metrics": ["screenPageViews", "averageSessionDuration"]}
  ]
}

Realtime Reports

Fetch real-time data (last 30 minutes):

python skills/ga4-api/scripts/realtime_report.py \
  --property-id 123456789 \
  --dimensions unifiedScreenName \
  --metrics activeUsers

Pivot Reports

Create pivot table reports:

python skills/ga4-api/scripts/pivot_report.py \
  --property-id 123456789 \
  --start-date 2025-01-01 \
  --end-date 2025-01-07 \
  --dimensions sessionSource,sessionMedium \
  --pivot-dimension deviceCategory \
  --metrics sessions

Read the full file on GitHub · 201 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 201 lines · 0 tokens per session scan A 98a581aad3c4

Subscribe to this mod's changes

ga4-api is a skill published in the GitHub repository Buzzmatic/awesome-agent-skills (1 stars, last pushed 2mo ago), licensed MIT. It adds 67 tokens to every session and 1,322 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens