TagDrift
README.md
<div align="center">
# 📡 TagDrift
**Open-source Tracking Pixel, Google Consent Mode v2 (`gcd`/`gcs`) & Silent SEO Drift Monitor**
*Catch dropped GA4/Meta pixels, broken Consent Mode v2 parameters, and accidental `noindex` / `robots.txt` leaks before paid ad spend or organic traffic disappears.*
[](https://tagdrift.onrender.com)
[](./LICENSE)
[](#-official-mcp-server-claude-cursor-windsurf-antigravity)
[](https://render.com/deploy?repo=https://github.com/lonebeast007850/tagdrift)
<br />
<a href="https://tagdrift.onrender.com">
<img src="./docs/hero.png" alt="TagDrift — Free Tracking Pixel, Consent Mode v2 and SEO Drift Monitor" width="960" />
</a>
</div>
---
## Why TagDrift?
Enterprise tag monitors like ObservePoint and Tag Inspector cost **USD 10,000–30,000/yr**. Meanwhile, indie SaaS founders, Shopify stores, Next.js teams, and performance agencies regularly lose weeks of ad attribution or Google rankings when a deploy silently:
- Drops **GA4 (`G-`)**, **Google Tag Manager (`GTM-`)**, **Meta Pixel**, **TikTok**, **LinkedIn**, or **Stripe.js**
- Breaks **Google Consent Mode v2** (`gcd=13r3r3r3r5`, `gcd=13l3l3l3l5l1`, `gcs=G100`–`G111`) or fires ad beacons before consent
- Ships staging **`Disallow: /`** in `robots.txt` or **`<meta name="robots" content="noindex">`** to production
- Breaks **`og:image`** social preview cards or introduces uncaught production JS runtime errors
**TagDrift catches all of these automatically** — free, open-source, self-hostable, and usable with zero login.
---
## Free Live Tools (No Sign-Up Required)
| Tool | Live URL | What It Does |
| --- | --- | --- |
| **Live Site Telemetry Audit** | [tagdrift.onrender.com](https://tagdrift.onrender.com) | Instant tracking tag, CMP, SEO, `robots.txt`, canonical, `og:image`, and JSON-LD audit with shareable `/report/<id>` URL |
| **Consent Mode v2 Decoder** | [tagdrift.onrender.com/tools/gcd-decoder](https://tagdrift.onrender.com/tools/gcd-decoder) | Instantly decode GA4 `gcd` (10-char & 12-char extended), `gcs` (`G100`–`G111`, `G1--`), or full `/g/collect` beacon URLs |
| **Robots & Noindex Checker** | [tagdrift.onrender.com/tools/robots-checker](https://tagdrift.onrender.com/tools/robots-checker) | Check `robots.txt` Googlebot rules, `<meta name="robots">`, `X-Robots-Tag`, canonical, and `og:image` HTTP status |
| **Private Drift Dashboard** | [tagdrift.onrender.com/dashboard](https://tagdrift.onrender.com/dashboard) | Schedule recurring checks, set baselines, simulate drift, and route alerts to **Slack, Discord, n8n, Zapier, or Email** |
---
## Key Features
- **Hybrid Scanner Engine:** Runs full **Playwright Chromium** (network beacon capture, CMP detection, runtime `pageerror` & console error monitoring) when Chrome is installed, or lightweight **Fast HTTP Mode** (~55 MB RAM) on free-tier containers.
- **Google Consent Mode v2 Parser:** Accurately decodes `ad_storage`, `analytics_storage`, `ad_user_data`, and `ad_personalization` across standard (`13r3r3r3r5`) and extended 12-char (`13l3l3l3l5l1`) `gcd` flags.
- **Exact Before → After Drift Diffing:** Compare current scans against your approved baseline with field-level severity (`CRITICAL`, `WARNING`, `INFO`), 24h alert deduplication, exponential backoff for unreachable domains, and one-click `Accept as Baseline`.
- **Webhooks & Email Alerts:** Native Slack Block Kit, Discord embeds, generic JSON webhooks (n8n / Zapier / Make), plus Resend HTML email alerts with 1-click unsubscribe.
- **Production Security Hardened:** SSRF IP/DNS & redirect guard (`validatePublicUrl` + Playwright request interception), CSP & security headers, CSRF `Origin` protection, sliding-window rate limits, timing-safe auth & OTP lockout, zero external DB required (built-in `node:sqlite`).
---
## 🤖 Official MCP Server (Claude, Cursor, Windsurf, Antigravity)
TagDrift ships with a built-in **Model Context Protocol (MCP)** stdio server (`src/mcp/server.ts`) so AI coding agents can verify production tags, Consent Mode v2, and SEO right after every deploy.
### Exposed MCP Tools
1. `audit_website` — Run a full tracking pixel, Consent Mode v2, and SEO audit on any public URL
2. `decode_consent_mode` — Decode any GA4 `gcd`, `gcs`, or `/g/collect` URL
3. `check_robots_noindex` — Verify `robots.txt` Googlebot crawlability and `noindex` leaks
4. `list_monitors_and_drift` — Inspect configured monitors and recent drift events
### Add to Claude Desktop / Cursor / Antigravity MCP Config
```json
{
"mcpServers": {
"tagdrift": {
"command": "node",
"args": ["/absolute/path/to/tagdrift/dist/mcp/server.js"]
}
}
}
```
---
## Quickstart (Self-Host Locally in 60 Seconds)
Requires **Node.js 22.13+** (uses Node's built-in `node:sqlite` — zero native C++ build tools needed).
```bash
git clone https://github.com/lonebeast007850/tagdrift.git
cd tagdrift
npm ci
npm run build
npm start
# Open http://localhost:3456
```
### Run Tests
```bash
npm test
```
### Deploy Free in 1 Click (Render — Free Tier, No Credit Card)
[](https://render.com/deploy?repo=https://github.com/lonebeast007850/tagdrift)
Or deploy with full headless Chromium via [`Dockerfile`](./Dockerfile) on Fly.io (`fly.toml` included), Railway, or any VPS.
---
## Optional Environment Variables
| Variable | Purpose |
| --- | --- |
| `APP_URL` | Canonical public URL (automatically falls back to `RENDER_EXTERNAL_URL`) |
| `PORT` | HTTP listen port (default `3456`, Render uses `10000`) |
| `DATABASE_PATH` | SQLite file location (default `./data/tagdrift.sqlite`) |
| `ADMIN_SECRET` | Unlocks `/admin?secret=...` analytics dashboard & CSV exports |
| `RESEND_API_KEY` + `EMAIL_FROM` | Enables live passwordless email login & HTML drift email alerts |
| `GOOGLE_SITE_VERIFICATION` / `BING_SITE_VERIFICATION` | Optional Search Console / Bing Webmaster `<meta>` verification tags |
| `TAGDRIFT_API_KEY` | Optional static `x-api-key` for CI/CD (GitHub Actions / n8n) monitor triggers |
---
## License
MIT © 2026 TagDrift Contributors — free to use, self-host, and contribute.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues