google-analytics

google-analytics is a skill for Claude Code, Codex from LichAmnesia/lich-skills. It costs 59 tokens per session (2,000 once invoked), scanned A, original, MIT.

A read-only analysis of Google Analytics 4, Google's service for measuring website visits and user behaviour. It uses aggregated reporting data rather than information about individual people.

In plain words
What is it for?
Use it for website performance reviews, SEO and traffic-source analysis, landing-page comparisons, bounce-rate checks, and device comparisons.
Why use it?
It helps explain traffic patterns, high-bounce pages, conversion differences, and changes between time periods without editing the analytics setup.

Skill for Claude CodeCodex

Part of the lich-skills plugin — 12 skills shipped together

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.

agentmods
npx agentmods add skills/lichamnesia/lich-skills/google-analytics
Any agent
npx skills add LichAmnesia/lich-skills --skill google-analytics
Clone the repo
git clone --depth 1 https://github.com/LichAmnesia/lich-skills

Made for: Claude Code, Codex.

Or install lich-skills, the plugin that ships this one along with the rest of its 12 skills.

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/lichamnesia/lich-skills/google-analytics.svg)](https://agentmods.dev/skills/lichamnesia/lich-skills/google-analytics)
Your own site
<a href="https://agentmods.dev/skills/lichamnesia/lich-skills/google-analytics"><img src="https://agentmods.dev/badge/skills/lichamnesia/lich-skills/google-analytics.svg" alt="Measured on agentmods" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,000 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 $0.00059 $0.02000
Opus 5 $0.00030 $0.01000
Sonnet 5 $0.00012 $0.00400
Haiku 4.5 $0.00006 $0.00200

Measured 4d ago against content hash 3f5db8e57a47, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/analyze.ts, scripts/daily-report.ts, scripts/ga-client.ts), 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/google-analytics/SKILL.md · 146 lines

How it starts

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

Google Analytics 4 Analysis

Pull GA4 data via the Data API and turn it into actionable, prioritized recommendations. Scripts are TypeScript (run with Bun or npx tsx).

When to use

  • "Give me a daily SEO report for this property" → daily-report.ts (the out-of-the-box default)
  • "Review our Google Analytics performance for the last 30 days"
  • "How is organic search doing?" / "Which landing pages pull organic traffic?"
  • "What are our top traffic sources?"
  • "Which pages have the highest bounce rates?"
  • "Compare this month vs last month"
  • "Why is mobile converting worse than desktop?"

When NOT to use

  • Real-time / streaming analytics — this uses the batch reporting API
  • Editing GA config, audiences, or events — read-only by design
  • Anything needing PII / individual-user data — GA4 returns aggregates only

Setup

1. Credentials (env vars)

export GOOGLE_ANALYTICS_PROPERTY_ID="YOUR_PROPERTY_ID_HERE"   # numeric, not the G- id
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"

Or copy .env.example.env (Bun auto-loads .env; under tsx, export the vars instead). Full service-account walkthrough is inside .env.example.

Never commit the JSON key or .env. Store the key outside the repo; grant the service account only the Viewer role on the GA4 property.

2. Install the one dependency

cd skills/google-analytics/scripts
bun install            # or: npm install

The only runtime dep is @google-analytics/data (official Google client, fully typed).

Scripts

daily-report.ts — SEO daily report (out-of-the-box default) ⭐

Point it at one property and get a complete, opinionated organic-search report — zero config beyond credentials. This is the SEO-expert default template.

bun run daily-report.ts --property 123456789      # one property → one report
bun run daily-report.ts                            # uses GOOGLE_ANALYTICS_PROPERTY_ID
bun run daily-report.ts --format json --output today.json

Read the full file on GitHub · 146 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 146 lines · 59 tokens per session scan A 3f5db8e57a47

Subscribe to this mod's changes

google-analytics is a skill published in the GitHub repository LichAmnesia/lich-skills (233 stars, last pushed 2mo ago), licensed MIT. It adds 59 tokens to every session and 2,000 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-30.