mcpField
G
google-analytics

google-analytics

github.com/henkisdabroMarketing & growth9360 installsUpdated 4w ago
Repository

About google-analytics

A GA4 implementation and analysis skill for event tracking, configuration, and reporting. It also describes using the read-only analytics-mcp server for live data, while directing configuration changes to the GA4 UI or Admin API.

Key features

  1. 01GA4 setup and tracking installation
  2. 02Event categories and parameter guidance
  3. 03Ecommerce and cross-device tracking
  4. 04Custom reports and dimensions
  5. 05Read-only live data query guidance

Use cases

  1. 01Set up a GA4 property and data stream
  2. 02Plan custom events and report parameters
  3. 03Review ecommerce funnel tracking
  4. 04Analyze GA4 data with realtime reports

MCP support

The bundled analytics-mcp is a read-only MCP server for Data API reports, funnel and realtime reports, and account, property, custom-definition, and Google Ads link details. Configuration changes must be made through the GA4 UI or the external Admin API.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/henkisdabro/wookstar-claude-plugins --skill google-analytics

After installing, type/google-analyticsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
audiences.md
bigquery.md
custom-dimensions.md
custom-events.md
data-management.md
debugview.md
events-fundamentals.md
gtag.md
gtm-integration.md
measurement-protocol.md
privacy.md
recommended-events.md
reporting.md
setup.md
user-tracking.md

Details

From the project README

Google Analytics 4

GA4 is event-based: every interaction is an event with parameters. Pick the reference from the decision tree below and read it before answering anything beyond the Quick Start.

The bundled analytics-mcp server (Google's official GA MCP) is read-only: it runs Data API reports, funnel and realtime reports, and reads account, property, custom-definition and Google Ads link details. Use it to answer questions about live GA4 data; configuration changes are made in the GA4 UI or through the Admin API outside this server.

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:
      <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:
    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
Linking BigQuery / export schema?           -> references/bigquery.md
Querying export data with SQL?              -> the bigquery skill
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:

CategoryDescriptionExamples
AutomaticFire without configurationsession_start, first_visit
Enhanced MeasurementToggle on/off in settingsscroll, click, file_download
RecommendedGoogle-defined with standard parameterspurchase, login, sign_up
CustomBusiness-specific trackingdemo_requested, trial_started
Key Limits
LimitValue
Distinct event names500 per app stream (no limit for web)
Parameters per event25
Event name length40 characters
Parameter name/value length40 / 100 characters (page_location 1,000)
Custom dimensions (event/user/item)50 / 25 / 10
Audiences per property100
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 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, then register custom item parameters as custom dimensions
Cross-Device Tracking
  1. Implement User ID and configure Reporting Identity (Admin -> Data Settings)
  2. Set user properties and build cross-device audiences
GDPR Compliance
  1. Set up Consent Mode with default denied state
  2. Integrate with CMP (OneTrust, Cookiebot, etc.), update consent on user acceptance
  3. Test consent implementation with DebugView
Custom Reports
  1. Understand available data in reporting
  2. Register custom parameters as dimensions, create Explorations
  3. 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

Comments

Markdown supported