google-analytics
Installation
SKILL.md
Google Analytics 4 (GA4) Manager
This skill provides a standardized approach to setting up, verifying, and optimizing Google Analytics 4 properties. It covers programmatic setup via the Google Analytics Admin API, manual code integration, and optimization audits.
How to use this skill
- Assess Current State: Check if the website currently has Google Analytics. Use web scraping tools (like Firecrawl or native page requests) to look for
G-XXXXXXXXXXIDs in the source code. - Setup Strategy: Determine if you need to create a new GA4 property or integrate an existing one.
- Programmatic Creation (Optional): If the user provides a Google Cloud Service Account with Analytics Admin access, use the included
ga_admin.pyscript to create properties and data streams programmatically. - Code Integration: Inject the correct GA4 implementation code into the project (e.g., using
@next/third-parties/googlefor Next.js, or rawgtag.jsfor plain HTML). - Optimization & Auditing: Review the site's layout and suggest custom events for key interactions (e.g., lead forms, e-commerce purchases, outbound clicks).