Google Tag Manager
Audit containers, inspect tags and triggers, review workspace changes, and manage version history.
Overview
The Google Tag Manager integration connects your GTM containers to Claude Code through Presso, giving you instant visibility into tags, triggers, variables, workspaces, and version history — all through natural language queries.
Instead of manually auditing containers tag by tag, ask Claude Code "What tags fire on the purchase page?" and get a complete breakdown with trigger conditions and variable dependencies.
Setup
Prerequisites
- A Google account with access to at least one Google Tag Manager container
- A Presso account with an active subscription
- Claude Code installed and configured with the Presso MCP server
Connect Google Tag Manager
- Open the Presso dashboard.
- Click Add Connection and select Google Tag Manager.
- Sign in with your Google account and grant Presso read-only access to your GTM data.
- Select the GTM account and container(s) you want to connect.
- Once authorized, the connection appears on your dashboard with a green Connected status.
Note: Presso requests read-only access. It cannot create, modify, or publish tags, triggers, variables, or container versions.
Available tools
The GTM integration provides the following tools:
| Tool | Description |
|---|---|
gtm_list_accounts | List all GTM accounts you have access to |
gtm_list_containers | List containers within a GTM account |
gtm_get_container | Get detailed information about a specific container |
gtm_list_tags | List all tags in a container workspace |
gtm_get_tag | Get detailed configuration for a specific tag |
gtm_list_triggers | List all triggers in a container workspace |
gtm_get_trigger | Get detailed configuration for a specific trigger |
gtm_list_variables | List all variables in a container workspace |
gtm_get_variable | Get detailed configuration for a specific variable |
gtm_list_workspaces | List all workspaces in a container |
gtm_list_versions | List published container versions |
gtm_get_version | Get details for a specific container version |
Key concepts
Container hierarchy
GTM is organized in a hierarchical structure:
Account
└── Container (one per website/app)
├── Workspace (draft changes)
│ ├── Tags (what fires)
│ ├── Triggers (when it fires)
│ └── Variables (dynamic values)
└── Versions (published snapshots)
Tags, triggers, and variables
| Component | Purpose | Example |
|---|---|---|
| Tag | Code that executes when conditions are met | GA4 event tag, Meta Pixel, conversion tracking |
| Trigger | Defines when a tag fires | Page view, button click, form submission |
| Variable | Dynamic value used in tags or triggers | Page URL, click text, data layer variable |
Workspaces
Workspaces are isolated draft environments where changes are made before publishing. A container always has a Default Workspace, and additional workspaces can be created for parallel development.
Versions
When a workspace is published, it creates a new version — an immutable snapshot of all tags, triggers, and variables at that point in time. Versions provide a complete audit trail of changes.
Example queries
Container overview
List all GTM containers I have access to.
Show me the details of my main website container.
How many tags, triggers, and variables are in my production container?
Tag management
List all active tags in my container.
Which tags are currently paused?
Show me all GA4 event tags and what triggers they use.
What tags fire on the purchase/thank-you page?
Trigger inspection
Show triggers for GA4 events.
List all click triggers and what tags they activate.
Which triggers use custom events from the data layer?
Show me all page view triggers and their URL filter conditions.
Variable review
List all custom variables in my container.
Which variables read from the data layer?
Show me all constant variables and their values.
Are there any unused variables that I can clean up?
Workspace management
List all workspaces for my container.
What changes are pending in the default workspace?
Are there any workspaces with unpublished changes?
Version history
Show me the last 10 published container versions.
What changed in the most recent published version?
Who published the last container version, and when?
Compare the current workspace to the latest published version — what's different?
Tag auditing
Tag auditing is one of the most valuable use cases for the GTM integration. Use Claude Code to systematically review your container for issues.
Completeness audit
Ensure all necessary tracking is in place:
Give me a complete inventory of all tags by type (GA4, Meta Pixel, Google Ads, custom HTML, etc.).
Are there any pages where GA4 page view tracking is missing based on the trigger configuration?
Redundancy check
Identify duplicate or conflicting tags:
Are there any duplicate tags that fire on the same triggers?
Do I have multiple GA4 configuration tags? There should only be one.
Performance review
Tags can impact page load speed. Identify potential issues:
List all custom HTML tags — these may contain third-party scripts that affect performance.
Which tags fire on "All Pages"? Are all of them necessary?
Show me tags that fire on DOM Ready vs. Page View vs. Window Loaded — help me understand the firing sequence.
Security review
Check for potentially risky configurations:
Are there any custom HTML tags that load external scripts? List the domains.
Which tags inject JavaScript into the page?
Debugging support
When tracking issues arise, use the GTM integration to investigate without opening the GTM UI:
Missing conversions
Show me the conversion tracking tag and its trigger. What conditions must be met for it to fire?
Does the purchase event tag require any data layer variables? Which ones?
Unexpected tag behavior
Which tags fire on form submission triggers? Is there one that shouldn't be there?
Show me the trigger conditions for the GA4 purchase event — is it filtering by the correct URL?
Data layer issues
List all tags and triggers that depend on data layer variables. Which data layer keys are expected?
What variables reference "ecommerce" in the data layer?
Version management
Track changes and maintain an audit trail with version history:
Change tracking
What tags were added, modified, or removed in the last published version?
Show me a chronological list of container versions from the past month.
Rollback analysis
When something breaks after a publish:
Compare the two most recent container versions — what exactly changed?
Which tags were modified in the latest publish? One of them might be causing the issue.
Common GTM analysis patterns
Pre-launch checklist
Before launching a new page or feature:
Audit my container for the new checkout flow: Do I have page view tracking, add-to-cart events, purchase events, and conversion tags properly configured with the right triggers?
Monthly tag audit
Run a regular hygiene check:
Give me a full container audit: total tag count, paused tags, tag types breakdown, triggers with no associated tags, and any variables that aren't referenced by any tag or trigger.
Migration preparation
When preparing to migrate to a new analytics platform:
List all tags that send data to Universal Analytics (UA). I need to replace them with GA4 equivalents.
Tips and best practices
- Audit regularly. Containers accumulate tags over time. A monthly review helps catch redundant, broken, or unnecessary tags before they cause issues.
- Check trigger specificity. Tags that fire on "All Pages" when they should only fire on specific pages waste resources and can cause data quality issues.
- Review before publishing. Use the version comparison queries to understand exactly what's changing before publishing a new version.
- Document with queries. Use Claude Code to generate an inventory of your container's tags, triggers, and variables as living documentation for your team.
- Watch for custom HTML. Custom HTML tags are powerful but can introduce security risks and performance issues. Audit them frequently.
- Cross-reference with GA4. Combine GTM container data with GA4 event data to verify that tags are firing correctly and data is flowing as expected.
Limitations
- Presso provides read-only access to GTM. To make changes, use the GTM web interface or API directly.
- Workspace comparison is based on the current state of each workspace and the latest published version.
- Tag firing order within the same trigger priority cannot be guaranteed through configuration alone.
- Server-side GTM containers may have different available features depending on your configuration.
Next steps
- Google Analytics 4 Integration — Verify that your GTM tags are sending the right data to GA4.
- Google Ads Integration — Check that conversion tracking tags in GTM match your Google Ads conversion actions.
- Troubleshooting — General tips for resolving common issues with Presso integrations.