google-analytics
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
- Create property: analytics.google.com -> Admin -> Create -> Property
- Create data stream: Add web stream, note Measurement ID (G-XXXXXXXXXX)
- Install tracking (choose one):
- GTM (recommended): Install container, create Google Tag with Measurement ID, trigger on All Pages, publish
- gtag.js direct:
<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>
- Verify: Enable GA Debugger extension, check Admin -> DebugView for session_start, page_view
- Send custom events:
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
- Review recommended events for the purchase funnel: view_item -> add_to_cart -> begin_checkout -> purchase
- Structure items array (required: item_id OR item_name; recommended: price, quantity, item_category)
- Test with DebugView, then register custom item parameters as custom dimensions
Cross-Device Tracking
- Implement User ID and configure Reporting Identity (Admin -> Data Settings)
- Set user properties and build cross-device audiences
GDPR Compliance
- Set up Consent Mode with default denied state
- Integrate with CMP (OneTrust, Cookiebot, etc.), update consent on user acceptance
- Test consent implementation with DebugView
Custom Reports
- Understand available data in reporting
- Register custom parameters as dimensions, create Explorations
- For unsampled data, export to BigQuery
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
More from henkisdabro/wookstar-claude-code-plugins
tampermonkey
Write and debug Tampermonkey userscripts for browser automation, page modification, and web enhancement. Use whenever the user mentions userscripts, Tampermonkey, Greasemonkey, Violentmonkey, or wants to write a script that runs on a website - even if they don't say 'userscript' explicitly. Also trigger for: injecting JavaScript or CSS into web pages, modifying website behaviour, hiding page elements, form auto-fill, scraping page data, intercepting requests, detecting URL changes in SPAs, adding keyboard shortcuts to websites, tab audio control, or TypeScript userscripts. Covers all header tags (@match, @grant, @require, @run-in), GM_* synchronous APIs, GM.* promise-based APIs (recommended for new scripts), batch storage (GM.getValues/setValues v5.3+), binary data support (v5.4+), TypeScript setup via @types/tampermonkey, security sandboxing, and cross-browser compatibility (Chrome, Firefox, Edge). Do NOT use for Selenium/Puppeteer automation, browser extensions (WebExtensions/MV3), or server-side scripts.
95google-tagmanager
Comprehensive Google Tag Manager guide covering container setup, tags, triggers, variables, data layer, debugging, custom templates, and API automation. Use when working with GTM implementation, configuration, optimisation, troubleshooting, or any GTM-related tasks.
81google-apps-script
Comprehensive guide for Google Apps Script development covering all built-in services (SpreadsheetApp, DocumentApp, GmailApp, DriveApp, CalendarApp, FormApp, SlidesApp), triggers, authorization, error handling, and performance optimization. Use when automating Google Sheets operations, creating Google Docs, managing Gmail/email, working with Google Drive files, automating Calendar events, implementing triggers (time-based, event-based), building custom functions, creating add-ons, handling OAuth scopes, optimizing Apps Script performance, working with UrlFetchApp for API calls, using PropertiesService for persistent storage, or implementing CacheService for temporary data. Covers batch operations, error recovery, and JavaScript ES6+ runtime.
74shopify-theme-dev
Complete theme development guide including file structure, JSON templates, sections, snippets, settings schema, and Online Store 2.0 architecture. Use when creating Shopify themes, organizing theme files, building sections and blocks, working with .json template files, configuring settings_schema.json, creating snippets, or implementing theme customization features.
23shopify-developer
Complete Shopify development reference for Liquid templating, theme development (OS 2.0), GraphQL Admin API, Storefront API, custom app development, Shopify Functions, Hydrogen, performance optimisation, and debugging. Use when working with .liquid files, creating theme sections and blocks, writing GraphQL queries or mutations for Shopify, building Shopify apps with CLI and Polaris, implementing cart operations via Ajax API, optimising Core Web Vitals for Shopify stores, debugging Liquid or API errors, configuring settings_schema.json, accessing Shopify objects (product, collection, cart, customer), using Liquid filters, creating app extensions, working with webhooks, migrating from Scripts to Functions, or building headless storefronts with Hydrogen and React Router 7. Covers API version 2026-01.
17google-ads-scripts
Expert guidance for Google Ads Script development including AdsApp API, campaign management, ad groups, keywords, bidding strategies, performance reporting, budget management, automated rules, and optimization patterns. Use when automating Google Ads campaigns, managing keywords and bids, creating performance reports, implementing automated rules, optimizing ad spend, working with campaign budgets, monitoring quality scores, tracking conversions, pausing low-performing keywords, adjusting bids based on ROAS, or building Google Ads automation scripts. Covers campaign operations, keyword targeting, bid optimization, conversion tracking, error handling, and JavaScript-based automation in Google Ads editor.
12