TagSpy

Documentation

Everything about reading, watching and automating Google tag setups with TagSpy.

How it works

A published Google Tag Manager web container is a public JavaScript file at https://www.googletagmanager.com/gtm.js?id=GTM-XXXXXXX. The first statement of that file is a JSON object with every tag, trigger condition, rule and variable in the live version. TagSpy downloads it on the server, decodes it and renders the result. Nothing behind a Tag Manager login is touched: no workspaces, drafts, folders, notes, user-given names or permissions.

Google strips the names you give things in the Tag Manager UI when it publishes. TagSpy rebuilds a name from the entity type and its most identifying parameter, for example GA4 Event — purchase or Pageview — URL (HOST) equals example.com. When two entities would get the same name, the numeric ID is appended.

Inspectors

  • GTM (GTM-XXXXXXX): tags, triggers, variables, vendors, consent and a Tag Manager import file. Only web containers; server, AMP and app containers are not served as gtm.js.
  • GA4 (G- or GT-): key events, enhanced measurement, created and modified events, session timeout, cross-domain, signals, DMA and redaction, read from gtag.js.
  • Firebase (1:123:android:abc): the app's analytics config, key events, quotas, consent per Google service and the linked GA4 property. Apps without Analytics have no published config.
  • URLs: paste a website and TagSpy lists the containers and measurement IDs its HTML loads. Tags injected after consent or through a proxy are not found; paste the ID instead.

Only the published version is public. Consent findings are a checklist: enforcement can happen outside the container.

Free public endpoints

  • GET /api/gtm/GTM-XXXXXXX returns normalized JSON: tags, triggers, variables, stats, consent. Add ?format=gtm for an import file or ?refresh=1 to bypass the 15 minute cache.
  • GET /api/ga4/G-XXXXXXXXXX and GET /api/firebase/<appId> return the same for GA4 and Firebase.
  • POST /api/resolve with { "url": "https://example.com" } lists the containers and Google tag IDs a page loads.

Looking for scheduled scans, diffs and alerts? That is the authenticated REST API.

More