$npx -y skills add kwakseongjae/oh-my-design --skill google-analyticsAnalyze 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.
| 1 | # Google Analytics Analysis |
| 2 | |
| 3 | Analyze website performance using Google Analytics data to provide actionable insights and improvement recommendations. |
| 4 | |
| 5 | ## Quick Start |
| 6 | |
| 7 | ### 1. Setup Authentication |
| 8 | |
| 9 | This Skill requires Google Analytics API credentials. Set up environment variables: |
| 10 | |
| 11 | ```bash |
| 12 | export GOOGLE_ANALYTICS_PROPERTY_ID="your-property-id" |
| 13 | export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json" |
| 14 | ``` |
| 15 | |
| 16 | Or create a `.env` file in your project root: |
| 17 | |
| 18 | ```env |
| 19 | GOOGLE_ANALYTICS_PROPERTY_ID=123456789 |
| 20 | GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json |
| 21 | ``` |
| 22 | |
| 23 | **Never commit credentials to version control.** The service account JSON file should be stored securely outside your repository. |
| 24 | |
| 25 | ### 2. Install Required Packages |
| 26 | |
| 27 | ```bash |
| 28 | # Option 1: Install from requirements file (recommended) |
| 29 | pip install -r cli-tool/components/skills/analytics/google-analytics/requirements.txt |
| 30 | |
| 31 | # Option 2: Install individually |
| 32 | pip install google-analytics-data python-dotenv pandas |
| 33 | ``` |
| 34 | |
| 35 | ### 3. Analyze Your Project |
| 36 | |
| 37 | Once configured, I can: |
| 38 | - Review current traffic and user behavior metrics |
| 39 | - Identify top-performing and underperforming pages |
| 40 | - Analyze traffic sources and conversion funnels |
| 41 | - Compare performance across time periods |
| 42 | - Suggest data-driven improvements |
| 43 | |
| 44 | ## How to Use |
| 45 | |
| 46 | Ask me questions like: |
| 47 | - "Review our Google Analytics performance for the last 30 days" |
| 48 | - "What are our top traffic sources?" |
| 49 | - "Which pages have the highest bounce rates?" |
| 50 | - "Analyze user engagement and suggest improvements" |
| 51 | - "Compare this month's performance to last month" |
| 52 | |
| 53 | ## Analysis Workflow |
| 54 | |
| 55 | When you ask me to analyze Google Analytics data, I will: |
| 56 | |
| 57 | 1. **Connect to the API** using the helper script |
| 58 | 2. **Fetch relevant metrics** based on your question |
| 59 | 3. **Analyze the data** looking for: |
| 60 | - Traffic trends and patterns |
| 61 | - User behavior insights |
| 62 | - Performance bottlenecks |
| 63 | - Conversion opportunities |
| 64 | 4. **Provide recommendations** with: |
| 65 | - Specific improvement suggestions |
| 66 | - Priority level (high/medium/low) |
| 67 | - Expected impact |
| 68 | - Implementation guidance |
| 69 | |
| 70 | ## Common Metrics |
| 71 | |
| 72 | For detailed metric definitions and dimensions, see [REFERENCE.md](REFERENCE.md). |
| 73 | |
| 74 | ### Traffic Metrics |
| 75 | - Sessions, Users, New Users |
| 76 | - Page views, Screens per Session |
| 77 | - Average Session Duration |
| 78 | |
| 79 | ### Engagement Metrics |
| 80 | - Bounce Rate, Engagement Rate |
| 81 | - Event Count, Conversions |
| 82 | - Scroll Depth, Click-through Rate |
| 83 | |
| 84 | ### Acquisition Metrics |
| 85 | - Traffic Source/Medium |
| 86 | - Campaign Performance |
| 87 | - Channel Grouping |
| 88 | |
| 89 | ### Conversion Metrics |
| 90 | - Goal Completions |
| 91 | - E-commerce Transactions |
| 92 | - Conversion Rate by Source |
| 93 | |
| 94 | ## Analysis Examples |
| 95 | |
| 96 | For complete analysis patterns and use cases, see [EXAMPLES.md](EXAMPLES.md). |
| 97 | |
| 98 | ## Scripts |
| 99 | |
| 100 | The Skill includes utility scripts for API interaction: |
| 101 | |
| 102 | ### Fetch Current Performance |
| 103 | ```bash |
| 104 | python scripts/ga_client.py --days 30 --metrics sessions,users,bounceRate |
| 105 | ``` |
| 106 | |
| 107 | ### Analyze and Generate Report |
| 108 | ```bash |
| 109 | python scripts/analyze.py --period last-30-days --compare previous-period |
| 110 | ``` |
| 111 | |
| 112 | The scripts handle API authentication, data fetching, and basic analysis. I'll interpret the results and provide actionable recommendations. |
| 113 | |
| 114 | ## Troubleshooting |
| 115 | |
| 116 | **Authentication Error**: Verify that: |
| 117 | - `GOOGLE_APPLICATION_CREDENTIALS` points to a valid service account JSON file |
| 118 | - The service account has "Viewer" access to your GA4 property |
| 119 | - `GOOGLE_ANALYTICS_PROPERTY_ID` matches your GA4 property ID (not the measurement ID) |
| 120 | |
| 121 | **No Data Returned**: Check that: |
| 122 | - The property ID is correct (find it in GA4 Admin > Property Settings) |
| 123 | - The date range contains data |
| 124 | - The service account has been granted access in GA4 |
| 125 | |
| 126 | **Import Errors**: Install required packages: |
| 127 | ```bash |
| 128 | pip install google-analytics-data python-dotenv pandas |
| 129 | ``` |
| 130 | |
| 131 | ## Security Notes |
| 132 | |
| 133 | - **Never hardcode** API credentials or property IDs in code |
| 134 | - Store service account JSON files **outside** version control |
| 135 | - Use environment variables or `.env` files for configuration |
| 136 | - Add `.env` and credential files to `.gitignore` |
| 137 | - Rotate service account keys periodically |
| 138 | - Use least-privilege access (Viewer role only) |
| 139 | |
| 140 | ## Data Privacy |
| 141 | |
| 142 | This Skill accesses aggregated analytics data only. It does not: |
| 143 | - Access personally identifiable information (PII) |
| 144 | - Store analytics data persistently |
| 145 | - Share data with external services |
| 146 | - Modify your Google Analytics configuration |
| 147 | |
| 148 | All data is processed locally and used only to generate recommendations during the conversation. |