Testing and Debugging Tags
You'll learn: How to verify your tag management implementation works correctly using GTM preview mode, browser DevTools, and specialized debugging tools.
Why Testing Tags Matters
After setting up tags, triggers, and the data layer, you need to confirm everything fires correctly before going live. Broken tracking means lost data—and you won't know until it's too late. Testing tags is like checking your mirrors before changing lanes: a small effort that prevents big problems.
GTM Preview Mode
Google Tag Manager's built-in preview mode is your first debugging tool. It shows:
- Which tags fired (or didn't fire) on each page
- What triggered them
- The exact data layer values at firing time
- Any errors preventing execution
Access it via the "Preview" button in the GTM interface. Your site opens with a debugging panel showing real-time tag activity as you navigate.
Browser DevTools Network Tab
Use DevTools to verify tags make actual network requests:
- Filter by domain (e.g.,
google-analytics.com) - Inspect request payloads to confirm correct parameters
- Check response codes (200 = success)
- Verify tracking pixels load
This confirms tags aren't just "firing" in GTM—they're actually sending data.
Console and Tag Assistant Tools
Watch the browser console for:
- Data layer push events:
dataLayer.push()calls - Tag-specific debug output (many tools log to console)
- JavaScript errors blocking execution
Browser extensions like Google Tag Assistant or Facebook Pixel Helper provide visual confirmation that specific tags are present and working.
Debugging Workflow
- Enable GTM preview mode
- Perform user actions (page views, clicks, form submits)
- Verify expected tags fire in the preview panel
- Check DevTools Network tab for actual requests
- Inspect console for errors or data layer issues
Key Takeaway: Always test tags using GTM preview mode combined with browser DevTools before publishing—verify both that tags fire in GTM and that they successfully send data to their destinations.