Web Analytics & Tracking MCP Server
Enables sending server-side events to Google Analytics 4 via Measurement Protocol, validating event payloads against GA4 e-commerce schemas, and generating gtag.js tracking snippets.
Provides DataLayer schema validation for GTM and generates GTM dataLayer.push tracking code snippets.
Audits tracking event payloads for Meta Conversions API (CAPI), scoring readiness and providing recommendations.
Generates React tracking hooks for integrating analytics events.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Web Analytics & Tracking MCP ServerValidate my dataLayer push for purchase against the GA4 e-commerce schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Web Analytics & Tracking MCP Server
A production-ready Model Context Protocol (MCP) server for Google Tag Manager (GTM), Google Analytics 4 (GA4) Measurement Protocol, DataLayer schema validation, Meta CAPI auditing, and tracking code snippet generation.
📌 Features
🎯 DataLayer Schema Validator: Automatically validates GTM
dataLayer.pushobjects against GA4 e-commerce schemas (purchase,add_to_cart,lead, etc.).🚀 GA4 Measurement Protocol Event Transmitter: Transmits server-side events directly to Google Analytics 4 via Measurement Protocol API.
🛠️ Tracking Code Snippet Generator: Generates production-ready code snippets for GTM
window.dataLayer.push, GA4gtag.js, and React tracking hooks.📊 Tracking Quality & EMQ Auditor: Audits tracking event payloads for GA4 and Meta Conversions API (CAPI), scoring readiness from 0-100 and providing recommendations.
📑 Built-in Specification Resource: Exposes static GA4 e-commerce standard schemas as an MCP resource (
ga4://spec/ecommerce).
Related MCP server: mcp-gtm-ga4
🛠️ Quick Start
1. Prerequisites
Node.js: v18.0.0 or higher
npm: v9.0.0 or higher
2. Installation & Build
# Clone repository
git clone https://github.com/webanalyticsprobd-maker/tracking-mcp-server.git
cd tracking-mcp-server
# Install dependencies
npm install
# Compile TypeScript
npm run build3. Environment Setup (Optional)
Copy .env.example to .env and fill in your GA4 credentials if you plan to send live server-side Measurement Protocol events:
GA4_MEASUREMENT_ID=G-XXXXXXXXXX
GA4_API_SECRET=your_ga4_api_secret_here⚙️ How to Connect to MCP Clients
Cursor IDE Configuration
Add the following snippet to your Cursor MCP Tools settings or .cursor/mcp.json:
{
"mcpServers": {
"tracking-analytics-server": {
"command": "node",
"args": ["C:/path/to/tracking-mcp-server/dist/index.js"],
"env": {
"GA4_MEASUREMENT_ID": "G-XXXXXXXXXX",
"GA4_API_SECRET": "your_api_secret"
}
}
}
}Claude Desktop Configuration
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"tracking-analytics-server": {
"command": "node",
"args": ["C:/path/to/tracking-mcp-server/dist/index.js"]
}
}
}📄 License
Licensed under the MIT License.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Google Ads, Meta Ads & GA4 MCP server - 250+ tools for campaigns, creatives, audiences & reports.
Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.
Hosted OAuth MCP for Google, Meta, X, and LinkedIn Ads, GA4, and Search Console.
All HasData scraping tools in one MCP server: Google, TikTok, Instagram, maps, e-commerce and more.
Related MCP Servers
- AlicenseBqualityAmaintenanceProduction-grade MCP server for the Google Tag Manager API v2 with read-only GA4 (Admin + Data API) tooling. 107 tools covering the full GTM surface, including server-side containers. Ships read-only: writes, publishes, and deletes are each gated behind separate opt-in flags, every mutation requires per-call confirmation, and a dry-run mode simulates changes. Includes container audits1001,1341MIT
- AlicenseAqualityAmaintenanceMCP server for Google Tag Manager and GA4, enabling tag management, consent auditing, workspace versioning, and analytics reporting through natural language.18612MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for Google Tag Manager and Google Ads, enabling AI agents to audit, fix, and manage GTM containers and Google Ads campaigns programmatically.518MIT
- AlicenseNot gradedqualityAmaintenanceAn open-source, local-first MCP server for automated Schema.org JSON-LD generation, GA4 metric validation, /llm.txt auditing, and content stickiness analytics.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/webanalyticsprobd-maker/tracking-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server