Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
davila7 avatar

Google Analytics

  • 978 installs
  • 29.9k repo stars
  • Updated July 27, 2026
  • davila7/claude-code-templates

google-analytics is a Claude Code skill that connects Claude-powered agents to live Google Analytics 4 data for automated performance reports and insights.

About

google-analytics is an analytics integration skill from davila7/claude-code-templates that wires coding agents to Google Analytics 4 using a numeric Property ID and a Google Cloud service account JSON key via GOOGLE_APPLICATION_CREDENTIALS. Setup requires creating a service account in Google Cloud Console, storing the JSON key outside the git repository, and configuring GOOGLE_ANALYTICS_PROPERTY_ID from GA4 Admin → Property Settings. Developers reach for google-analytics when they want agents to pull real traffic, conversion, and engagement metrics into automated reports instead of manually exporting GA4 dashboards. The skill targets teams already running GA4 on a live property who need programmatic access for recurring performance summaries.

  • Provides ready-to-use .env template for GA4 Property ID and service account credentials
  • Includes step-by-step Google Cloud and GA4 setup instructions with exact roles and paths
  • Delivers practical analysis examples such as 30-day traffic overview with period comparison
  • Prevents credential leakage by explicitly instructing to keep JSON key outside git repository
  • Enables agentic analytics workflows that fetch metrics, detect trends, and generate summaries

Google Analytics by the numbers

  • 978 all-time installs (skills.sh)
  • +24 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #300 of 2,066 Data Science & ML skills by installs in the Skillselion catalog
  • Security screen: HIGH risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/davila7/claude-code-templates --skill google-analytics

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs978
repo stars29.9k
Security audit2 / 3 scanners passed
Last updatedJuly 27, 2026
Repositorydavila7/claude-code-templates

How do agents query Google Analytics 4 data programmatically?

Connect Claude-powered agents to real Google Analytics 4 data for automated performance reports and insights.

Who is it for?

Developers with a live GA4 property who want coding agents to pull real analytics data into automated performance reports.

Skip if: Teams without GA4 configured or without Google Cloud service account access should skip google-analytics until property tracking and API credentials exist.

When should I use this skill?

User asks to connect Google Analytics, pull GA4 metrics, automate analytics reports, or configure GOOGLE_ANALYTICS_PROPERTY_ID and service account keys.

What you get

GA4 API connection config, automated performance reports, and agent-generated analytics insights

  • GA4 API environment configuration
  • Automated performance reports
  • Agent-generated analytics insights

Files

SKILL.mdMarkdownGitHub ↗

Google Analytics Analysis

Analyze website performance using Google Analytics data to provide actionable insights and improvement recommendations.

Quick Start

1. Setup Authentication

This Skill requires Google Analytics API credentials. Set up environment variables:

export GOOGLE_ANALYTICS_PROPERTY_ID="your-property-id"
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"

Or create a .env file in your project root:

GOOGLE_ANALYTICS_PROPERTY_ID=123456789
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json

Never commit credentials to version control. The service account JSON file should be stored securely outside your repository.

2. Install Required Packages

# Option 1: Install from requirements file (recommended)
pip install -r cli-tool/components/skills/analytics/google-analytics/requirements.txt

# Option 2: Install individually
pip install google-analytics-data python-dotenv pandas

3. Analyze Your Project

Once configured, I can:

  • Review current traffic and user behavior metrics
  • Identify top-performing and underperforming pages
  • Analyze traffic sources and conversion funnels
  • Compare performance across time periods
  • Suggest data-driven improvements

How to Use

Ask me questions like:

  • "Review our Google Analytics performance for the last 30 days"
  • "What are our top traffic sources?"
  • "Which pages have the highest bounce rates?"
  • "Analyze user engagement and suggest improvements"
  • "Compare this month's performance to last month"

Analysis Workflow

When you ask me to analyze Google Analytics data, I will:

1. Connect to the API using the helper script 2. Fetch relevant metrics based on your question 3. Analyze the data looking for:

  • Traffic trends and patterns
  • User behavior insights
  • Performance bottlenecks
  • Conversion opportunities

4. Provide recommendations with:

  • Specific improvement suggestions
  • Priority level (high/medium/low)
  • Expected impact
  • Implementation guidance

Common Metrics

For detailed metric definitions and dimensions, see REFERENCE.md.

Traffic Metrics

  • Sessions, Users, New Users
  • Page views, Screens per Session
  • Average Session Duration

Engagement Metrics

  • Bounce Rate, Engagement Rate
  • Event Count, Conversions
  • Scroll Depth, Click-through Rate

Acquisition Metrics

  • Traffic Source/Medium
  • Campaign Performance
  • Channel Grouping

Conversion Metrics

  • Goal Completions
  • E-commerce Transactions
  • Conversion Rate by Source

Analysis Examples

For complete analysis patterns and use cases, see EXAMPLES.md.

Scripts

The Skill includes utility scripts for API interaction:

Fetch Current Performance

python scripts/ga_client.py --days 30 --metrics sessions,users,bounceRate

Analyze and Generate Report

python scripts/analyze.py --period last-30-days --compare previous-period

The scripts handle API authentication, data fetching, and basic analysis. I'll interpret the results and provide actionable recommendations.

Troubleshooting

Authentication Error: Verify that:

  • GOOGLE_APPLICATION_CREDENTIALS points to a valid service account JSON file
  • The service account has "Viewer" access to your GA4 property
  • GOOGLE_ANALYTICS_PROPERTY_ID matches your GA4 property ID (not the measurement ID)

No Data Returned: Check that:

  • The property ID is correct (find it in GA4 Admin > Property Settings)
  • The date range contains data
  • The service account has been granted access in GA4

Import Errors: Install required packages:

pip install google-analytics-data python-dotenv pandas

Security Notes

  • Never hardcode API credentials or property IDs in code
  • Store service account JSON files outside version control
  • Use environment variables or .env files for configuration
  • Add .env and credential files to .gitignore
  • Rotate service account keys periodically
  • Use least-privilege access (Viewer role only)

Data Privacy

This Skill accesses aggregated analytics data only. It does not:

  • Access personally identifiable information (PII)
  • Store analytics data persistently
  • Share data with external services
  • Modify your Google Analytics configuration

All data is processed locally and used only to generate recommendations during the conversation.

Related skills

FAQ

What credentials does google-analytics require?

google-analytics requires a numeric GA4 Property ID (from Admin → Property Settings, not the G- measurement ID) and a Google Cloud service account JSON key referenced by GOOGLE_APPLICATION_CREDENTIALS, stored outside the git repository.

What reports can agents generate with google-analytics?

google-analytics enables Claude-powered agents to query live GA4 data and produce automated performance reports covering traffic, engagement, and conversion metrics from the configured property.

Is Google Analytics safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.