# Google analytics

> Google analytics is an open-source agent skill for marketing and seo. Lets your agent pull GA4 reports and turn them into prioritized SEO and traffic fixes. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/LichAmnesia/lich-skills/tree/main/skills/google-analytics
- **Repository:** https://github.com/lichamnesia/lich-skills
- **GitHub stars:** 233
- **License:** MIT
- **Skill name:** google-analytics
- **Collection:** https://github.com/LichAmnesia/lich-skills
- **Categories:** [marketing and SEO](https://ai-powered.com/categories/marketing-and-seo), [analytics and data](https://ai-powered.com/categories/analytics-and-data)
- **Listing updated:** 2026-12-02

## About

This skill lets an AI coding agent query Google Analytics 4 through the Data API and interpret the results. It covers organic search performance, traffic sources, high-bounce pages, device gaps and period-over-period comparisons, and ends with recommendations ranked by priority and expected impact.

The main entry point is a daily report script that filters everything to the Organic Search channel, compares rolling 28-day windows, flags day-over-day drops against the same weekday of the prior week, and lists top landing pages, search engines, countries and devices. A lower-level client runs arbitrary metric and dimension combinations, and an analysis script produces pre-built overviews with recommendations. The skill also documents running the daily report on a schedule with cron or a scheduled Claude Code agent.

The scripts are written in TypeScript and run under Bun or npx tsx. You need a GA4 numeric property ID and a Google service-account key granted Viewer access on that property. The skill is read-only and reports aggregated data only. It does not provide keyword, impression or position data, which must come from Google Search Console.

## When your agent uses it

> Analyze Google Analytics 4 data — review website performance, identify traffic patterns, diagnose high-bounce pages, compare time periods, and suggest data-driven improvements. Use when the user asks about analytics, website metrics, traffic analysis, conversion rates, user behavior, or performance optimization.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs TypeScript scripts](https://github.com/LichAmnesia/lich-skills/tree/HEAD/skills/google-analytics)
- [No network calls found in its scripts](https://github.com/LichAmnesia/lich-skills/tree/HEAD/skills/google-analytics)
- [License: MIT](https://github.com/LichAmnesia/lich-skills/tree/HEAD/skills/google-analytics)

## Features

- **Daily organic SEO report:** A single-command report covering organic KPIs, daily anomaly checks, trends and top landing pages.
- **Flexible GA4 queries:** A raw query client accepts any mix of metrics, dimensions, filters, ordering and date ranges.
- **Prebuilt analysis types:** Overview, sources, content, devices and SEO analyses return metrics alongside prioritized recommendations.
- **Bounce and device diagnostics:** Identifies high-bounce pages and compares mobile and desktop performance gaps.
- **Scheduled reporting:** Documents running the daily report via cron or a scheduled agent that summarizes the top fixes.
- **Read-only, least-privilege access:** Uses a service account with Viewer role and returns aggregates only, with no config writes.

## Good for

- Give me a daily SEO report for my GA4 property
- How is organic search traffic doing over the last 28 days?
- Which landing pages get the most organic visits?
- Which pages have the highest bounce rates and why?
- Why is mobile converting worse than desktop?
- Compare this month's traffic against last month

## Install

### Claude Code

This skill ships in the `lich-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add LichAmnesia/lich-skills
/plugin install lich-skills@lich-skills
```

Or copy only this skill to `~/.claude/skills/google-analytics`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/LichAmnesia/lich-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/google-analytics &&
cp -R "$tmp/skills/google-analytics" ~/.claude/skills/google-analytics &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/google-analytics` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/google-analytics` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/LichAmnesia/lich-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/google-analytics &&
cp -R "$tmp/skills/google-analytics" ~/.agents/skills/google-analytics &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/google-analytics` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/google-analytics` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/LichAmnesia/lich-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/google-analytics &&
cp -R "$tmp/skills/google-analytics" ~/.cursor/skills/google-analytics &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/google-analytics` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/LichAmnesia/lich-skills.git --path skills/google-analytics
```

Or copy the folder to `~/.gemini/skills/google-analytics` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/google-analytics`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/LichAmnesia/lich-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/google-analytics &&
cp -R "$tmp/skills/google-analytics" ~/.copilot/skills/google-analytics &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/google-analytics` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/LichAmnesia/lich-skills.git
```

Then copy `lich-skills/skills/google-analytics` into your agent's skills folder as `google-analytics`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What do I need to set up before running Google analytics?

A numeric GA4 property ID, a service-account JSON key stored outside the repo, Viewer access for that service account on the property, and one dependency installed in the scripts folder with bun install or npm install.

### Can Google analytics show keyword rankings or impressions?

No. GA4 has no keyword, impression, CTR or average position data. The skill notes that this comes from Google Search Console, which is a separate API.

### Does Google analytics change my Analytics configuration?

No. The skill is read-only and does not edit GA config, audiences or events.

### Which data is included in the reports?

Only aggregated GA4 data is returned. The skill states it does not access individual-user or PII data.

### How do I install Google analytics in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/google-analytics to use it in all your projects, or to .claude/skills/google-analytics in one project. Or install the lich-skills plugin, which includes it: /plugin marketplace add LichAmnesia/lich-skills, then /plugin install lich-skills@lich-skills.

### Does Google analytics run scripts?

Yes. It runs TypeScript scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Google analytics?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Google analytics?

The closest alternatives to Google analytics are AI traffic analytics, SEO audit, SEO google, SEO matomo and AI visibility.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [AI traffic analytics](https://ai-powered.com/skills/ai-traffic-analytics): AI traffic analytics is an open-source agent skill for marketing and seo.
- [SEO audit](https://ai-powered.com/skills/seo-audit-ryze-ai-adgent): SEO audit is an open-source agent skill for marketing and seo.
- [SEO google](https://ai-powered.com/skills/seo-google): SEO google is an open-source agent skill for marketing and seo.
- [SEO matomo](https://ai-powered.com/skills/seo-matomo): SEO matomo is an open-source agent skill for marketing and seo.
- [AI visibility](https://ai-powered.com/skills/ai-visibility-ryze-ai-adgent): AI visibility is an open-source agent skill for marketing and seo.
- [Analytics tracking](https://ai-powered.com/skills/analytics-tracking): Analytics tracking is an open-source agent skill for marketing and seo.
- [SEO seranking](https://ai-powered.com/skills/seo-seranking): SEO seranking is an open-source agent skill for marketing and seo.
- [Google analytics data API basics](https://ai-powered.com/skills/google-analytics-data-api-basics): Google analytics data API basics is an open-source agent skill for analytics and data.

---
Source: https://ai-powered.com/skills/google-analytics-lichamnesia
