New to Claude Skills? Learn how to install them →

davila7 on GitHub

Google Analytics Analysis

Free

Gain insights from your Google Analytics data.

Get this skill

Free · Opens the source repo

What Google Analytics Analysis does

The Google Analytics Analysis skill is designed to help users leverage their Google Analytics data to improve website performance. By connecting to the Google Analytics API, this skill allows users to analyze website traffic, user behavior, and conversion metrics. It provides actionable insights and recommendations based on the data retrieved, enabling users to make data-driven decisions to enhance their online presence.

To get started, users must set up authentication by configuring their Google Analytics API credentials. This involves setting environment variables or creating a .env file to securely store sensitive information. Once configured, the skill can fetch various metrics, such as sessions, bounce rates, and user engagement levels, allowing users to review their website's performance over specified periods.

The skill is particularly useful for web developers, marketers, and business analysts who want to understand how users interact with their websites. It can identify top-performing pages and traffic sources, analyze conversion funnels, and suggest improvements to optimize user engagement. Users can ask specific questions about their analytics data, and the skill will provide detailed analyses and recommendations based on the responses.

With built-in scripts for fetching performance data and generating reports, this skill simplifies the process of analyzing Google Analytics data. It emphasizes best practices for security and data privacy, ensuring that users can confidently access and analyze their data without compromising sensitive information.

When to use it

Use this skill when you need to analyze website performance metrics, identify traffic patterns, or improve user engagement based on data.

When not to use it

This skill is not suitable for real-time analytics or for users who require access to personally identifiable information (PII).

What you can build with it

Review Website Performance

Use the skill to analyze your website's performance over the last month and identify key metrics.

Identify Traffic Sources

Ask the skill to provide insights on where your website traffic is coming from and which sources are most effective.

Analyze User Engagement

Request an analysis of user engagement metrics to understand how visitors interact with your site.

How to install Google Analytics Analysis

View source

1. Install with the skills CLI

npx skills add davila7/claude-code-templates/google-analytics --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by davila7

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.

Frequently asked questions about Google Analytics Analysis

Similar skills