google-analytics
Automates the retrieval and analysis of website metrics, traffic sources, and user behavior from Google Analytics.
Install
mkdir -p .claude/skills/google-analytics && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1501" && unzip -o skill.zip -d .claude/skills/google-analytics && rm skill.zipInstalls to .claude/skills/google-analytics
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Analyze Google Analytics data, review website performance metrics, identify traffic patterns, and suggest data-driven improvements. Use when the user asks about analytics, website metrics, traffic analysis, conversion rates, user behavior, or performance optimization.Key capabilities
- →Fetch traffic and user behavior metrics
- →Identify top-performing website pages
- →Analyze traffic sources and acquisition
- →Compare performance across time periods
- →Generate data-driven improvement reports
How it works
The skill connects to the Google Analytics API using service account credentials to fetch metrics into a pandas-compatible format. It then processes this data to identify trends and performance bottlenecks.
Inputs & outputs
When to use google-analytics
- →Analyzing traffic sources for specific landing pages
- →Identifying high bounce rate pages
- →Comparing conversion performance over time
- →Reporting on user engagement metrics
About this skill
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:
- Connect to the API using the helper script
- Fetch relevant metrics based on your question
- Analyze the data looking for:
- Traffic trends and patterns
- User behavior insights
- Performance bottlenecks
- Conversion opportunities
- 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_CREDENTIALSpoints to a valid service account JSON file- The service account has "Viewer" access to your GA4 property
GOOGLE_ANALYTICS_PROPERTY_IDmatches 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
.envfiles for configuration - Add
.envand 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.
When not to use it
- →When attempting to access personally identifiable information
- →When using an incorrect property ID or unauthorized service account
Prerequisites
Limitations
- →Requires secure handling of service account JSON files
- →Limited to aggregated data analysis
- →Performance depends on the accuracy of the property ID and date range
How it compares
It provides automated analysis and specific recommendations based on raw data, rather than requiring manual dashboard navigation.
Compared to similar skills
google-analytics side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| google-analytics (this skill) | 43 | 6mo | Review | Intermediate |
| campaign-analytics | 0 | 4mo | Review | Intermediate |
| backtesting-trading-strategies | 10 | 27d | Review | Intermediate |
| spark-optimization | 4 | 2mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by davila7
View all by davila7 →You might also like
campaign-analytics
adamtasteslikegood
Analyzes campaign performance with multi-touch attribution, funnel conversion, and ROI calculation for marketing optimization
backtesting-trading-strategies
jeremylongshore
Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".
spark-optimization
wshobson
Optimize Apache Spark jobs with partitioning, caching, shuffle optimization, and memory tuning. Use when improving Spark performance, debugging slow jobs, or scaling data processing pipelines.
ascend-profiling-analysis
Ascend
Analyze Ascend NPU profiling data to identify training performance bottlenecks. Breaks down step-level time into compute, unoverlapped communication, and freetime; within compute, analyzes compute vs memory-bound ratios and cube vs vector utilization to summarize the model's performance bottleneck.
spark-optimization
bika11
Optimize Apache Spark jobs with partitioning, caching, shuffle optimization, and memory tuning. Use when improving Spark performance, debugging slow jobs, or scaling data processing pipelines.
benchmark-harness
loveSunning
Use when creating or revising CUDA benchmark runners and result artifacts.