Tracking coverage audit
audit_event_coverageAudit analytics event coverage by comparing codebase events, live GTM tags, and GA4 firings to flag missing, paused, or untagged events.
Instructions
Three-way audit: codebase events ↔ GTM tags ↔ GA4 actual fires.
Fetches the LIVE GTM container, joins it against GA4 event counts for the date range, and returns a per-event matrix with one of these statuses: ok — tag active and event firing ok_auto_collected — GA4 Enhanced Measurement event, no tag needed no_tag_no_fire — codebase event, no GTM tag, never fires tag_paused — GTM tag exists but is paused tag_active_but_not_firing — tag is active but no GA4 hits gtm_only_firing — GA4 event from a tag, not in codebase gtm_paused_but_firing — only paused tag(s), not in codebase, yet GA4 still fires (event comes from elsewhere) gtm_only_not_firing — tag exists, not in codebase, no fires ga4_only — fires in GA4, no tag, no codebase ref ga4_fires_no_tag — codebase event firing without a GTM tag auto_event_only — Enhanced Measurement event with no codebase ref
The result also lists dynamic-event tags ({{Event}} variables) and Custom HTML tags that the audit cannot interpret automatically.
Tag Manager API: https://developers.google.com/tag-platform/tag-manager/api/v2
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| property_id | No | GA4 property as "properties/123456789". Empty uses the default from config. | |
| date_range_end | No | End date "YYYY-MM-DD". Empty (or an empty date_range_start) means the last 30 days. | |
| gtm_account_id | No | Numeric GTM account ID (Tag Manager UI → Admin → Container Settings, or list_gtm_accounts). Empty uses gtm.account_id from the config. | |
| expected_events | Yes | Distinct event names found in the codebase's gtag('event', ...) and dataLayer.push({event: ...}) calls. | |
| date_range_start | No | Start date "YYYY-MM-DD". Empty (or an empty date_range_end) means the last 30 days. | |
| gtm_container_id | No | Numeric GTM container ID (not the GTM-XXXXXXX public ID; see list_gtm_containers). Empty uses gtm.container_id from the config. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||