Google Tag Manager GTM Setup Verification Guide

posted 4 min read

GTM Setup Verification Guide

Method 1: GTM Preview Mode (Most Comprehensive)

Step-by-Step Instructions:

  1. Open GTM Console

  2. Enable Preview Mode

    • Click the "Preview" button in the top-right corner
    • GTM will generate a preview URL
  3. Test Your Website

    • Open the preview URL in a new tab
    • Your website will load with GTM debug panel at the bottom
  4. Verify Events

    • The debug panel shows all events being fired
    • You should see events like:
      • page_view
      • form_field_focus
      • button_click
      • scroll_depth
      • section_view
  5. Test Interactions

    • Fill out the form
    • Click buttons
    • Scroll through the page
    • Navigate between sections
    • Watch events appear in real-time

Method 2: Browser Developer Tools

Check GTM Container Loading:

  1. Open Developer Tools (F12)
  2. Go to Network Tab
  3. Refresh the page
  4. Look for GTM requests:
    • googletagmanager.com/gtm.js
    • googletagmanager.com/gtm.js?id=GTM-5XFLRN8P

Check dataLayer:

  1. Open Console Tab
  2. Type: window.dataLayer
  3. Press Enter
  4. You should see an array with events

Test Event Tracking:

// In browser console, test manually:
window.dataLayer.push({
    'event': 'test_event',
    'event_category': 'test',
    'event_action': 'verification'
});

Method 3: GTM Container Verification

Check Container Code:

  1. Verify Head Code (in index.html):

    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-5XFLRN8P');</script>
    <!-- End Google Tag Manager -->
    
  2. Verify Body Code (in index.html):

    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5XFLRN8P"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->
    

Method 4: Event-Specific Testing

Test Each Event Type:

  1. Page View Event:

    • Open website
    • Check console for: GTM Event: page_view
  2. Form Events:

    • Click on form fields
    • Submit the form
    • Check for: form_field_focus, form_submission, form_success
  3. Button Events:

    • Click various buttons
    • Check for: button_click, cta_button_click, demo_button_click
  4. Navigation Events:

    • Click navigation links
    • Check for: navigation_click
  5. Scroll Events:

    • Scroll through the page
    • Check for: scroll_depth, section_view

Method 5: GTM Container Status Check

In GTM Console:

  1. Container Status:

    • Should show "Published" status
    • Check for any errors in container
  2. Tags Configuration:

    • Verify tags are set up to trigger on your events
    • Check tag firing rules
  3. Triggers:

    • Ensure triggers are configured for your events
    • Test trigger conditions
  4. Variables:

    • Verify data layer variables are set up
    • Check variable configurations

Method 6: Real-Time Testing

Using Google Analytics (if connected):

  1. Open Google Analytics
  2. Go to Real-Time > Events
  3. Interact with your website
  4. Watch events appear in real-time

Using GTM Real-Time:

  1. In GTM Console
  2. Go to Preview Mode
  3. Interact with website
  4. Watch events in debug panel

Common Issues & Solutions

Issue 1: GTM Not Loading

Symptoms: No GTM requests in Network tab
Solutions:

  • Check container ID is correct
  • Verify GTM code is in <head> section
  • Check for JavaScript errors

Issue 2: Events Not Firing

Symptoms: No events in dataLayer
Solutions:

  • Check JavaScript console for errors
  • Verify trackEvent function is working
  • Test with manual dataLayer.push()

Issue 3: Events Firing but Not Reaching GTM

Symptoms: Events in dataLayer but not in GTM
Solutions:

  • Check GTM container is published
  • Verify trigger configurations
  • Test in preview mode

Issue 4: Duplicate Events

Symptoms: Same event firing multiple times
Solutions:

  • Check for duplicate event listeners
  • Verify event tracking logic
  • Use event deduplication in GTM

Verification Checklist

  • [ ] GTM container loads without errors
  • [ ] dataLayer is accessible in console
  • [ ] Page view event fires on load
  • [ ] Form events fire on interaction
  • [ ] Button click events fire
  • [ ] Scroll depth events fire
  • [ ] Navigation events fire
  • [ ] Events appear in GTM preview mode
  • [ ] No JavaScript errors in console
  • [ ] GTM container is published

Debugging Commands

Console Commands for Testing:

// Check if GTM is loaded
console.log('GTM Loaded:', typeof window.dataLayer !== 'undefined');

// Check dataLayer contents
console.log('DataLayer:', window.dataLayer);

// Manually trigger an event
window.dataLayer.push({
    'event': 'manual_test',
    'event_category': 'debug',
    'event_action': 'console_test'
});

// Check GTM container ID
console.log('GTM ID:', 'GTM-5XFLRN8P');

// Test trackEvent function
if (typeof trackEvent === 'function') {
    trackEvent('test_event', {test: true});
}

Expected Events in GTM

When testing, you should see these events:

  1. Page Load:

    • page_view
  2. Form Interactions:

    • form_field_focus
    • form_field_blur
    • form_submission
    • form_success
  3. Button Clicks:

    • button_click
    • cta_button_click
    • demo_button_click
  4. Navigation:

    • navigation_click
  5. User Engagement:

    • scroll_depth
    • section_view
    • user_engagement
  6. Carousel:

    • carousel_navigation
  7. External Links:

    • external_link_click

Next Steps After Verification

  1. Set up GTM Triggers for each event
  2. Configure Tags (Google Analytics, Facebook Pixel, etc.)
  3. Test in Production environment
  4. Monitor Real-Time Data
  5. Set up Conversion Tracking
  6. Configure Enhanced Ecommerce (if applicable)
If you read this far, tweet to the author to show them you care. Tweet a Thanks
0 votes

More Posts

Everything you need to know about Google Summer of Code (GSoC)

emmo00 - Mar 24

Full-Stack vs. Data Science: Which Career Path Scales Better in 2025

Sunny - Aug 8

Repohistory

Max Shen - Aug 5

Secrets and Keys: The History of Encryption

m13ha - Sep 28

PrintPigeon - Send Letters Online

PrintPigeonUK - Jun 19
chevron_left