google-analytics

google-analytics is a skill for Claude Code from VKirill/claude-lane-stack. It costs 188 tokens per session (5,736 once invoked), scanned A, original, MIT.

A reference guide for the Google Analytics 4 APIs, which let software retrieve website or app usage data such as sessions, users, and conversions. It covers API versions, client libraries, filters, reports, real-time data, and storing summaries in PostgreSQL.

In plain words
What is it for?
Use it to build dashboards, take daily snapshots, monitor recent traffic, compare date ranges, filter reports, and load aggregate GA4 data into PostgreSQL.
Why use it?
It provides instructions for collecting and comparing analytics data programmatically instead of manually exporting reports or guessing the API request format.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is Source of truth: [STACK_VERSIONS.md](../../STACK_VERSIONS.md) — verified 2026-08-24.

Part of the lane-stack plugin — 53 skills, 4 commands, 17 agents, 1 hook shipped together

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/VKirill/claude-lane-stack
agentmods
npx agentmods add skills/vkirill/claude-lane-stack/google-analytics

Made for: Claude Code.

Or install lane-stack, the plugin that ships this one along with the rest of its 53 skills, 4 commands, 17 agents, 1 hook.

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 google-analytics

README.md
[![agentmods](https://agentmods.dev/badge/skills/vkirill/claude-lane-stack/google-analytics.svg)](https://agentmods.dev/skills/vkirill/claude-lane-stack/google-analytics)
Your own site
<a href="https://agentmods.dev/skills/vkirill/claude-lane-stack/google-analytics"><img src="https://agentmods.dev/badge/skills/vkirill/claude-lane-stack/google-analytics.svg" alt="Measured on agentmods" height="20"></a>
Per session 188 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,736 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00188 $0.05736
Opus 5 $0.00094 $0.02868
Sonnet 5 $0.00038 $0.01147
Haiku 4.5 $0.00019 $0.00574

Measured yesterday against content hash 9e887e1fbdde, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

google-analytics 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 yesterday.

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.

plugins/lane-stack/skills/google/google-analytics/SKILL.md · 316 lines

How it starts

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

Version Requirements (May 2026)

Primary pins:

  • GA4 Data API: v1beta (stable; base https://analyticsdata.googleapis.com/v1beta/)
  • GA4 Admin API: v1beta (https://analyticsadmin.googleapis.com/v1beta/)
  • Python client: google-analytics-data >= 0.18
  • Node.js client: @google-analytics/data ^4.x
  • Python: 3.14.x
  • Node.js: 24.x (Active LTS)

Source of truth: STACK_VERSIONS.md — verified 2026-08-24

Usage

Loaded automatically when its description matches the active task. Read only the section you need, then follow the link to the relevant reference file for full detail.

Use this skill when

  • Programmatic pulls of GA4 data for dashboards: sessions, active users, conversions by source / channel / device
  • Daily GA4 snapshot to PostgreSQL for SQL analytics and LTV calculations (aggregates, not event-level)
  • Real-time traffic monitoring (last 30 min) for campaign launches, deployment monitoring, alerting
  • Comparative reporting across multiple periods (multiple dateRanges in one request)
  • Complex filtering: building FilterExpression with andGroup / orGroup / notExpression, stringFilter (EXACT, BEGINS_WITH, ENDS_WITH, CONTAINS, FULL_REGEXP, PARTIAL_REGEXP), inListFilter, numericFilter, betweenFilter
  • Pivot reports (2D crosstabs: source x device, country x device)
  • Cohort retention reports (firstSessionDate cohorts, DAILY/WEEKLY/MONTHLY granularity, cohortActiveUsers)
  • Batch efficiency: packing 5 reports into one HTTP call via batchRunReports
  • Configuration: listing properties, custom dimensions, conversion events via Admin API v1beta
  • Token budget monitoring (returnPropertyQuota: true and reading PropertyQuota in the response)
  • Backend authorization: service account granted access via Admin -> Property -> Property Access Management

Do not use this skill when

  • Universal Analytics (UA, UA-XXXXX) — sunset 2024-07-01, API disabled. Migration is not "switch the ID"; semantics differ (sessions vs events, dimensions, attribution). Move the account to GA4 first.
  • Event-level export (millions of raw rows) — Data API returns aggregates; for raw events use BigQuery Export GA4 (cascade -> bigquery)
  • Russian analog of GA4 — yandex-metrica (cascade -> yandex-metrica); a different dimension / metric universe
  • Search Console data (CTR / impressions / positions) — google-search-console (cascade)
  • Managing containers / triggers / tags — Google Tag Manager API, google-tag-manager (cascade)
  • Generic Google Cloud auth setup (service account creation, key issuance, gcloud auth) — google-cloud-auth (cascade)
  • A/B testing inside GA4 — either GTM + Optimize (deprecated) or a dedicated feature flag service
  • Writing data into GA4 — Data API is read-only; for event writes use Measurement Protocol (different API)
  • Parsing the GA4 UI (Explorations, default Acquisition / Engagement reports) — Data API does not mirror UI reports 1:1; build the slice yourself

Read the full file on GitHub · 316 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. yesterday First seen · 316 lines · 188 tokens per session scan A 9e887e1fbdde

Subscribe to this mod's changes

google-analytics is a skill published in the GitHub repository VKirill/claude-lane-stack (114 stars, last pushed 5d ago), licensed MIT. It adds 188 tokens to every session and 5,736 once invoked, about $0.0009 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-09-05.

Related

Other skills, from other repositories

moai-platform-database-cloud

Cloud database platform specialist covering Neon (serverless PostgreSQL), Supabase (PostgreSQL 16 with real-time), and Firebase Firestore (NoSQL with offline sync). Use when choosing or setting up cloud databases.

modu-ai/moai-adk · 51 tokens

postgres-patterns

PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.

loulanyue/awesome-claude-notes · 28 tokens

database-expert

Advanced database design and administration for PostgreSQL, MongoDB, and Redis. Use when designing schemas, optimizing queries, managing database performance, or implementing data patterns.

travisjneuman/.claude · 36 tokens

agent-database-reviewer

PostgreSQL database specialist for query optimization, schema design, security, and performance. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance. Incorporates Supabase best practices.

KunanonJ/ai-skills-hub · 50 tokens

analytics-reporter

-- Key Business Metrics Dashboard WITH monthlymetrics AS ( SELECT DATETRUNC('month', date) as month, SUM(revenue) as monthlyrevenue, COUNT(DISTINCT customerid) as activecustomers, AVG(ordervalue) as avgordervalue, SUM(revenue) / COUNT(DISTINCT customerid) as revenuepercustomer FROM transactions WHERE date >=…

TravisLeeeeee/awesome-openclaw-personas · 0 tokens

postgresql

Design a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.

KunanonJ/ai-skills-hub · 29 tokens