# GTM container audit: <container name> (<GTM-XXXXXXX>)

Start from `node <skill-folder>/scripts/audit-gtm-export.mjs <export> --config <config> --format md`, run in the audit folder, which fills most of this file. Replace every <placeholder>, rewrite the summary in business terms, and keep the finding IDs: the change list, exceptions and evidence files refer to them. A reader should know in five minutes what is wrong, what it costs and what happens first.

## Baseline

- Container: <name>, <GTM-XXXXXXX>, <web | server>
- Version audited: <ID> "<version name>", live: <yes | no, because ...>
- Source: <UI export | API versions.live with tagmanager.readonly | MCP server, granted scopes from the auth status call>
- Read time: <YYYY-MM-DD HH:MM UTC, or "unknown" with the reason>
- Counts: tags <n> (paused <n>), triggers <n>, variables <n>, custom templates <n>; they match <the Overview | the MCP summary>
- Script: <gtm-container-audit 0.3.0 with config <file> | not run (no Node), rules applied by hand from references/rules.md>
- Context files used: <stack.md, decisions.md, tracking plan, naming-rules.md, or what the user supplied>

## Status and score

- Status: <RED | AMBER | GREEN> (<static | confirmed>). <reasons, for example "3 P1 FAIL; 2 P2 FAIL on a biddable conversion">
- Score: <n>/100. The status decides what happens next; the score shows how much is left in each area.
- Consent and privacy (weight 25): <n>%
- Conversions and counting (weight 25): <n>%
- Google tag and GA4 setup (weight 15): <n>%
- Destinations and duplicates (weight 10): <n>%
- Custom code and security (weight 10): <n>%
- Triggers, variables and data layer (weight 10): <n>%
- Versions, workspaces and naming (weight 5): <n>%

## Summary for a colleague

1. <What is wrong with permission, in one sentence a marketing manager understands.>
2. <What is wrong with counting: which reported numbers are too high or too low, and roughly how.>
3. <Any exposed credential or compromised code, and who rotates or removes it.>
4. <What happens first: the first release and its date.>
5. <What reported numbers will move after the fix, and who has been told.>

## P1 findings

- <finding id> <FAIL | WARN> <rule>: <finding>. Runtime: <confirmed, refuted or unconfirmed, with the evidence reference>. Change request: <CR-n>.

## P2 findings

- <finding id> <FAIL | WARN> <rule>: <finding>. Runtime: <...>. Change request: <CR-n or "needs a decision">.

## P3 and P4 findings by rule

- <rule> <slug>: <one line per finding, or a count with the pattern, for example "4 unused triggers">

## PASS, INFO and NOT CHECKED by rule

- <rule> <slug>: <what was checked and found correct, or why it could not run>. Every rule the script ran appears in the P1, P2, P3 and P4 sections or here.

## Decisions needed

- <question>. Owner: <role>. Default if no answer by <date>: <what the change list does>.

## Destination ID inventory

- <kind> <ID>: <expected | retired | not on the expected list>. Used by <tags and variables>. <Question for the owner, if any.>
- Locations the script does not read: destination tags (type codes unconfirmed), Custom JavaScript variables, scripts loaded from other hosts.

## Consent overview

- <n> tags not configured, <n> configured.
- <tag> [<ID>]: consent <notset | notneeded | needed>, gate <require additional consent | trigger condition or exception | code | built-in Google checks | none>

## Checked outside the container

- Container loading ID and path: <gtm.js?id=GTM-... | G- or AW- ID, so non-Google tags will not run | not checked: reason>
- Environment parameters on production: <none | present on ... | not checked: reason>
- Page-level allowlist and blocklist: <none | classes ...>
- Senders outside the container: <none found in a fresh-profile page load | list with IDs>; data layer listener: <GTM listening on every page type | replaced on ...>
- Consent default owner: <CMP template | page code | Google tag override | Settings tab>, four signals per region: <values>
- Settings tab and Google destinations: <values, or not checked: reason>
- GA4 property settings: <enhanced measurement history and forms, data filters and their states, key events with exact case, Google signals, data redaction (email, query parameters)>
- Google Ads conversion actions: <checked by R11 against the export | not checked: reason>
- Versions, workspaces and environments: <latest ID vs live ID; workspaces and owners; environments in use>
- User permissions: <administrators, publishers, agency or former-staff access>
- Size indicator: <percent, or not shown>
- Tag coverage and diagnostics: <untagged pages, alerts>
- Optimize anti-flicker in page code: <absent | present on ...>
- Server container hand-off: <assets/server-handoff-template.md filled | not applicable>

## Not checked

- <item>: <reason, for example "no Read access to the Settings tab; evidence request sent to the container owner on YYYY-MM-DD">

## Runtime evidence

- <finding id>: <confirmed | refuted>. <test case, consent state, what fired, what request left the browser, where the record is stored>. Run by <role> on <date> with <approval and test data>.

## Unconfirmed leads

- <finding id>: <competing explanations, for example "the app pushes purchase twice" versus "two triggers match one push" versus "the server container sends a second copy">. Smallest next test that tells them apart: <test>. Who runs it and what approval it needs: <role, approval>.

## Accepted exceptions

- <finding id or rule>: <reason>. Decision <decisions.md reference>, approved by <role>, expires <YYYY-MM-DD>.

## Next steps

- Change list: <path>. Nothing in Tag Manager was changed by this audit.
- Re-audit: run the script on the new live version with the same config after each release; a request closes only when its finding is gone and no new P1 or P2 FAIL appears.
- Next scheduled audit: <date>, or after the next agency handover or major release.
