GTM Preview Mode: Debugging Tags Like a Pro
GTM Preview Mode is the most powerful debugging tool in a marketer's toolkit. Here is how to use every feature — including the ones most people ignore.
AttriModel Team
AttriModel Team
Entering Preview Mode
In GTM, click Preview in the top right. Enter your site URL and click Connect. A Tag Assistant panel opens in a new window — keep it visible alongside your site.
GTM Preview Mode injects a debug cookie into your browser so every page load on that domain shows debug data.
The Debug Panel Layout
Left panel — Events list: Every event that has fired since preview started. Click any event to inspect it.
Center panel — Tags: Shows which tags FIRED, which were BLOCKED, and which were NOT TRIGGERED for the selected event.
Right panel — Variables: The current value of every GTM variable at the time of the selected event.
The Most Useful Panels
Data Layer Tab
Shows every dataLayer.push() that occurred, in order. This is essential for debugging:
- Did the developer push the event at all?
- Are the variable names spelled correctly?
- Is the ecommerce object structured properly?
Variables Tab
Shows every built-in and user-defined variable value. Check:
- Is your Click URL variable capturing the right URL?
- Is your form ID variable detecting the right element?
- Are your Data Layer Variables reading the right keys?
Common Debugging Scenarios
Tag shows "Not Triggered":
Your trigger conditions are not being met. Check:
- Does the trigger event match what's happening? (e.g., Page View vs DOM Ready)
- Is your trigger filter too restrictive? Check the Variables tab for the actual value.
Tag fired but data is wrong in GA4:
The tag fired, so GTM did its job. Check:
- Are your GTM variables pulling the right values?
- Is the GA4 event name correct?
- Use GA4 DebugView alongside GTM Preview to verify what GA4 received.
Event in dataLayer but tag not firing:
The most common cause: your Custom Event trigger event name doesn't exactly match the event key in the dataLayer push. Case-sensitive, character-sensitive.
Using Preview With GTM Environments
If your site has separate Dev, Staging, and Production environments, use GTM's Environments feature to test unpublished containers on non-production URLs. This prevents publishing untested changes to production.
Keyboard Shortcut
Press Ctrl+Shift+J (or Cmd+Option+J on Mac) with the preview window active to open the browser console — useful for checking JavaScript errors that might be preventing tags from firing.