Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ga4-analytics

БесплатноЗапускает вложенные скриптыНе проверен

Google Analytics 4, Search Console and Indexing API toolkit: site traffic, top pages, traffic sources, demographics, real-time visitors, search queries, SEO…

adamkristopherот adamkristopher10 339 установок в других каталогах

Об этом скилле

GA4 Analytics Toolkit

What this skill does with your data

  • Network: calls Google only: the Analytics Data API, Search Console API and Indexing API (*.googleapis.com).
  • Credentials: a Google Cloud service account from .env in the working directory. Use least privilege: Viewer on the one GA4 property, and access to the one Search Console site. The Indexing API scope is needed only for reindexUrls / requestIndexing. Keep .env out of version control.
  • What's sent: your property ID, site URL, date ranges, and any URLs you ask to inspect or re-index.
  • Changes it can make: reindexUrls asks Google to recrawl URLs. removeFromIndex asks Google to drop a URL from Search; it refuses unless called with { confirm: true }, and should only be used when the site owner asks to remove that exact URL. Everything else is read-only.
  • Files: nothing is written unless you set SAVE_RESULTS=true; no function argument can turn saving on. Saved files are readable only by you (0600) and can only go in the results/ folders listed below.

Setup

Install the pinned dependencies from the lockfile:

cd scripts && npm ci --ignore-scripts

Configure credentials by creating a .env file in the project root:

GA4_PROPERTY_ID=123456789
[email protected]
GA4_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
SEARCH_CONSOLE_SITE_URL=https://your-domain.com
GA4_DEFAULT_DATE_RANGE=30d
# Optional: keep results on disk
# SAVE_RESULTS=true

Prerequisites: A Google Cloud project with the Analytics Data API, Search Console API, and Indexing API enabled. A service account with access to your GA4 property and Search Console.

Quick Start

User says Function to call
"Show me site traffic for the last 30 days" siteOverview("30d")
"What are my top search queries?" searchConsoleOverview("30d")
"Who's on the site right now?" liveSnapshot()
"Reindex these URLs" reindexUrls(["https://example.com/page1", ...])
"Compare this month vs last month" compareDateRanges({startDate: "30daysAgo", endDate: "today"}, {startDate: "60daysAgo", endDate: "31daysAgo"})
"What pages get the most traffic?" contentPerformance("30d")

Execute functions by importing from scripts/src/index.ts:

import { siteOverview, searchConsoleOverview } from './scripts/src/index.js';

const overview = await siteOverview('30d');

Or run it with the project's pinned tsx (installed by npm ci):

cd scripts && npm start

Workflow Pattern

Every analysis follows two phases:

1. Analyze

Run API functions. Each call hits the Google APIs and returns structured data to you. Nothing is written to disk.

2. Summarize

Summarize the returned data for the user: tables, trends and recommendations. Write a summary file only if the user asks for one.

Saving (opt-in): only with SAVE_RESULTS=true in .env are results also saved as timestamped JSON in results/{category}/ (YYYYMMDD_HHMMSS__operation__extra_info.json).

High-Level Functions

GA4 Analytics

Function Purpose What it gathers
siteOverview(dateRange?) Comprehensive site snapshot Page views, traffic sources, demographics, events
trafficAnalysis(dateRange?) Traffic deep-dive Sources, sessions by source/medium, new vs returning
contentPerformance(dateRange?) Top pages analysis Page views, landing pages, exit pages
userBehavior(dateRange?) Engagement patterns Demographics, events, daily engagement metrics
compareDateRanges(range1, range2) Period comparison Side-by-side metrics for two date ranges
liveSnapshot() Real-time data Active users, current pages, current events

Search Console

Function Purpose What it gathers
searchConsoleOverview(dateRange?) SEO snapshot Top queries, pages, device, country breakdown
keywordAnalysis(dateRange?) Keyword deep-dive Queries with device breakdown
seoPagePerformance(dateRange?) Page SEO metrics Top pages by clicks, country breakdown

Indexing

Function Purpose
reindexUrls(urls) Ask Google to recrawl multiple URLs
checkIndexStatus(urls) Check if URLs are indexed (read-only)

removeFromIndex(url, { confirm: true }) is available from the API module but is destructive: it asks Google to drop the URL from Search. Use it only when the site owner asks to remove that exact URL. See references/api-reference.md.

Utility

Function Purpose
getAvailableFields() List all available GA4 dimensions and metrics

Individual API Functions

For granular control, import specific functions from the API modules. See [references/a

Полный SKILL.md на ClawHub

Установить ga4-analytics в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл ga4-analytics?

Google Analytics 4, Search Console and Indexing API toolkit: site traffic, top pages, traffic sources, demographics, real-time visitors, search queries, SEO page performance, index status, re-index requests, and (only with explicit confirmation) requests to remove a URL from Google's index. Use when the user asks about their site's traffic, search queries or indexing. Uses the user's own Google service account from .env for one GA4 property and one Search Console site. Saves nothing to disk unless SAVE_RESULTS=true.

Как установить скилл ga4-analytics?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ga4-analytics запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить ga4-analytics с