google-analytics
Comprehensive Google Analytics 4 guide covering property setup, events, custom events, recommended events, custom dimensions, user tracking, audiences, reporting, BigQuery integration, gtag.js implementation, GTM integration, Measurement Protocol, DebugView, privacy compliance, and data management. Use when working with GA4 implementation, tracking, configuration, debugging, BigQuery export queries, gtag/dataLayer setup, or any GA4-related tasks. Do NOT use for Universal Analytics (sunset July 2024), Adobe Analytics, Mixpanel, Amplitude, or other non-GA4 platforms. Do NOT use for ad-platform reporting (use google-ads-scripts for that).
What this skill does
# Google Analytics 4 Complete Guide
## Overview
Google Analytics 4 (GA4) is Google's event-based analytics platform for measuring user interactions across websites and applications. Every user interaction is tracked as an event with associated parameters, providing flexible cross-platform measurement.
## When to Use This Skill
Invoke this skill for any GA4-related task:
- Setting up GA4 properties, data streams, and Measurement IDs
- Installing GA4 via gtag.js, GTM, or CMS plugins
- Implementing event tracking (automatic, recommended, custom, ecommerce)
- Creating custom dimensions, audiences, and reports
- Exporting data to BigQuery for SQL analysis
- Server-side tracking via Measurement Protocol
- User ID and cross-device tracking
- Privacy compliance, Consent Mode, and GDPR/CCPA
- Testing and debugging with DebugView
## Quick Start
1. **Create property:** analytics.google.com -> Admin -> Create -> Property
2. **Create data stream:** Add web stream, note Measurement ID (G-XXXXXXXXXX)
3. **Install tracking** (choose one):
- **GTM (recommended):** Install container, create Google Tag with Measurement ID, trigger on All Pages, publish
- **gtag.js direct:**
```html
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
```
4. **Verify:** Enable GA Debugger extension, check Admin -> DebugView for session_start, page_view
5. **Send custom events:**
```javascript
gtag('event', 'button_click', { button_name: 'Subscribe', button_location: 'header' });
```
## Decision Tree: Which Reference Do I Need?
```
What are you trying to do?
Setting up GA4 for the first time? -> references/setup.md
Understanding how events work? -> references/events-fundamentals.md
Implementing standard tracking events? -> references/recommended-events.md
Creating business-specific custom events? -> references/custom-events.md
Making parameters appear in reports? -> references/custom-dimensions.md
Implementing User ID / cross-device? -> references/user-tracking.md
Building audiences for remarketing? -> references/audiences.md
Analysing data in GA4 reports? -> references/reporting.md
Exporting to BigQuery for SQL analysis? -> references/bigquery.md
Installing via gtag.js directly? -> references/gtag.md
Setting up GA4 in Google Tag Manager? -> references/gtm-integration.md
Sending events from server/backend? -> references/measurement-protocol.md
Testing and debugging implementation? -> references/debugview.md
Implementing GDPR/Consent Mode? -> references/privacy.md
Configuring Admin settings? -> references/data-management.md
```
## Core Concepts
### Event-Based Model
GA4 tracks everything as events in four categories:
| Category | Description | Examples |
|----------|-------------|----------|
| Automatic | Fire without configuration | session_start, first_visit |
| Enhanced Measurement | Toggle on/off in settings | scroll, click, file_download |
| Recommended | Google-defined with standard parameters | purchase, login, sign_up |
| Custom | Business-specific tracking | demo_requested, trial_started |
### Key Limits
| Limit | Value |
|-------|-------|
| Event names per property | 500 distinct |
| Parameters per event | 25 |
| Event name length | 40 characters |
| Parameter name/value length | 40 / 100 characters |
| Custom dimensions (event/user/item) | 50 / 25 / 10 |
| Audiences per property | 100 |
### Measurement ID
- Format: `G-XXXXXXXXXX` (G- prefix + 10 alphanumeric characters)
- Location: Admin -> Data Streams -> Web Stream
- Used in: gtag.js config, GTM tags, Measurement Protocol
## Common Workflows
### Ecommerce Tracking
1. Review [recommended events](references/recommended-events.md) for the purchase funnel: view_item -> add_to_cart -> begin_checkout -> purchase
2. Structure items array (required: item_id OR item_name; recommended: price, quantity, item_category)
3. Test with [DebugView](references/debugview.md), then register custom item parameters as [custom dimensions](references/custom-dimensions.md)
### Cross-Device Tracking
1. Implement [User ID](references/user-tracking.md) and configure Reporting Identity (Admin -> Data Settings)
2. Set [user properties](references/custom-dimensions.md) and build [cross-device audiences](references/audiences.md)
### GDPR Compliance
1. Set up [Consent Mode](references/privacy.md) with default denied state
2. Integrate with CMP (OneTrust, Cookiebot, etc.), update consent on user acceptance
3. Test consent implementation with [DebugView](references/debugview.md)
### Custom Reports
1. Understand available data in [reporting](references/reporting.md)
2. Register custom parameters as [dimensions](references/custom-dimensions.md), create Explorations
3. For unsampled data, export to [BigQuery](references/bigquery.md)
## Best Practices
- **Naming:** Use snake_case, be descriptive and action-oriented, keep under 40 characters, avoid generic names
- **Implementation order:** Enhanced Measurement -> recommended events -> custom events -> custom dimensions
- **Data quality:** Separate test/production properties, set up internal traffic filters from day one, document all custom events, audit regularly with DebugView, export to BigQuery for backup
Related in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".