Tag Validation & Verification | Blue Frog Docs

Tag Validation & Verification

How to validate and verify that analytics tags are firing correctly and sending accurate data

Tag Validation & Verification

What This Means

Tag validation is the process of verifying that your analytics tags (Google Analytics, Facebook Pixel, Google Ads, etc.) are firing correctly, at the right time, with the right data. Without proper validation, you risk deploying tags that:

  • Don't fire at all
  • Fire multiple times (duplicate events)
  • Send incorrect or incomplete data
  • Fire on the wrong pages or events
  • Cause performance issues

Why it matters:

  • Invalid tags lead to inaccurate reporting and bad business decisions
  • Missing events mean lost conversion tracking and attribution
  • Duplicate events inflate metrics and waste ad spend
  • Performance issues affect user experience and SEO

How to Diagnose

Method 1: Google Tag Manager Preview Mode

The most powerful tool for validating GTM implementations:

  1. Enable Preview Mode

  2. Navigate and trigger events

    • Click through your site as a user would
    • Add items to cart, submit forms, etc.
    • Watch the Tag Assistant panel for events
  3. Check each tag

    • Look for "Tags Fired" vs "Tags Not Fired"
    • Click each tag to see trigger details
    • Verify data layer variables are populated

What to look for:

  • ✅ Tags fire when expected
  • ✅ All variables contain correct data
  • ✅ Tags fire only once per event
  • ❌ Tags in "Not Fired" that should have fired
  • ❌ Missing or undefined variables
  • ❌ Tags firing multiple times

Method 2: Google Analytics DebugView

For validating GA4 event data:

  1. Enable debug mode

    • Install Google Analytics Debugger Chrome extension, OR
    • Add ?gtm_debug=true to your URL, OR
    • Use GTM Preview Mode (automatically enables debug)
  2. Open DebugView

    • Go to GA4 property
    • Admin → DebugView
    • You'll see your current session
  3. Trigger events and validate

    • Perform actions on your site
    • Watch events appear in real-time
    • Click each event to inspect parameters

What to check:

  • Event names match your specification
  • All required parameters are present
  • Parameter values are correct (not "undefined" or null)
  • E-commerce items include all required fields
  • User properties are set correctly

Method 3: Browser DevTools Network Tab

For low-level validation and non-GTM implementations:

  1. Open DevTools

    • Press F12 or right-click → Inspect
    • Go to Network tab
    • Filter for analytics requests:
      • Google Analytics: filter for collect or g/collect
      • Facebook Pixel: filter for facebook.com/tr
      • Google Ads: filter for google.com/pagead
  2. Trigger events

    • Perform actions on your site
    • Watch for network requests
  3. Inspect payloads

    • Click on each request
    • View Payload or Query String Parameters
    • Verify event names and parameters

What to verify:

  • Requests fire when expected
  • Measurement ID / Pixel ID is correct
  • Event parameters are in the payload
  • No 404 or 400 errors on requests

Method 4: Tag Assistant (Chrome Extension)

For quick validation without GTM access:

  1. Install "Tag Assistant Legacy" Chrome extension
  2. Click the extension icon → Enable
  3. Refresh the page
  4. Click extension icon to see detected tags

Limitations:

  • Only detects common tags
  • Can't see data layer values
  • Less detailed than GTM Preview Mode

Method 5: ObservePoint / Automated Monitoring

For continuous validation and regression detection:

  1. Set up automated tag audits
  2. Configure alerts for tag failures
  3. Run audits on schedule or after deployments
  4. Review reports for issues

Best for:

  • Large sites with frequent updates
  • Enterprise implementations
  • Ongoing monitoring
  • Regression detection

General Fixes

Fix 1: Tag Not Firing at All

Diagnosis:

  • Tag appears in "Tags Not Fired" in GTM Preview
  • No network request in DevTools
  • Event not appearing in GA4 DebugView

Common causes:

  1. Trigger not configured correctly

    • Trigger condition doesn't match the event
    • Wrong trigger type (page view vs click)
    • Variable used in trigger is undefined
  2. Tag is paused or disabled

    • Check tag settings in GTM
    • Ensure tag is not set to only fire in specific environments
  3. JavaScript error on page

    • Check browser console for errors
    • Errors can prevent tags from firing

How to fix:

// Check if tag is enabled in GTM
// 1. Open tag in GTM
// 2. Check "Tag Configuration" section
// 3. Verify no exceptions are blocking the tag

// If using custom trigger, verify the condition:
// Example: Trigger should fire when button clicked
Trigger Type: Click - All Elements
Condition: Click Element matches CSS selector .purchase-button

// Test trigger in Preview Mode:
// 1. Enable Preview Mode
// 2. Perform the action
// 3. Check if trigger appears in "Summary" panel
// 4. If trigger doesn't fire, check trigger conditions

Fix 2: Tag Firing Multiple Times (Duplicates)

Diagnosis:

  • Same tag appears multiple times in "Tags Fired"
  • Multiple identical network requests in DevTools
  • Duplicate events in GA4 DebugView

Common causes:

  1. Multiple triggers firing the same tag

    • Check all triggers attached to the tag
    • Triggers may overlap
  2. Tag installed both in GTM and hardcoded

    • Base tracking code in site template
    • Also added via GTM
    • Results in double-counting
  3. Single Page App (SPA) re-firing tags

    • History Change trigger firing too often
    • Tags not designed for SPA behavior

How to fix:

// Check for hardcoded tags:
// 1. View page source (Ctrl+U)
// 2. Search for your Measurement ID (e.g., G-XXXXXXXXXX)
// 3. If found outside GTM, you have duplicate installation

// For SPA duplicate prevention:
// In GTM, use a Custom Variable to track if tag fired:
Variable Name: Tag Fired Flag
Variable Type: Custom JavaScript
Value:
function() {
  if (window.tagFired) {
    return false;
  }
  window.tagFired = true;
  return true;
}

// Then add trigger exception:
// Tag fires when: Tag Fired Flag equals true

Fix 3: Missing or Incorrect Data

Diagnosis:

  • Tag fires but parameters are missing
  • Variables show as "undefined" in Preview Mode
  • Event parameters empty in GA4 DebugView

Common causes:

  1. Data layer not populated before tag fires

    • Tag fires before data is available
    • Race condition between data push and tag
  2. Variable name mismatch

    • Variable name in GTM doesn't match data layer
    • Case-sensitive naming (transaction_id vs transactionId)
  3. Variable not defined in GTM

    • Forgot to create the variable
    • Variable configured incorrectly

How to fix:

// Method 1: Ensure data layer pushed before tag fires
// INCORRECT ORDER:
gtag('event', 'purchase', {...});  // Fires immediately
dataLayer.push({ transactionId: '123' });  // Too late!

// CORRECT ORDER:
dataLayer.push({
  event: 'purchase',
  transactionId: '123',
  value: 99.99
});
// GTM tag fires on custom event 'purchase'

// Method 2: Verify variable configuration in GTM
// 1. Go to Variables
// 2. Click your Data Layer Variable
// 3. Verify Data Layer Variable Name exactly matches your data layer
//    Data Layer Variable Name: transactionId
//    Must match: dataLayer.push({ transactionId: '123' })

// Method 3: Add default value for missing variables
// In GTM Variable settings:
// Data Layer Variable Name: transactionId
// Default Value: not_set
// This prevents undefined values

Fix 4: Tags Not Firing in Production

Diagnosis:

  • Tags work in Preview Mode
  • Tags work on staging environment
  • Tags don't fire on production site

Common causes:

  1. Container not published

    • Changes saved but not submitted/published
    • Wrong GTM container on production
  2. Environment-specific settings

    • Tag set to fire only in specific environments
    • Trigger conditions checking for staging URL
  3. Ad blockers on your own browser

    • Your ad blocker preventing tags
    • Other users may see them fine

How to fix:

// 1. Verify container is published:
// - In GTM, check "Versions" tab
// - Latest version should show as "Published"
// - If not, go to Workspace → Submit → Publish

// 2. Check environment restrictions:
// - Open each tag
// - Look for "Advanced Settings" → "Tag Firing Options"
// - Ensure no environment restrictions

// 3. Test without ad blockers:
// - Open incognito/private window
// - Disable all browser extensions
// - Test tag firing

// 4. Verify correct container ID on production:
// View page source, look for:
// GTM-XXXXXXX (should match your production container)

Fix 5: Performance Issues from Tags

Diagnosis:

  • Page load time increased after adding tags
  • Lighthouse performance score decreased
  • Tags blocking page rendering

Common causes:

  1. Synchronous tag loading

    • Tags loaded before page content
    • Blocking page render
  2. Too many tags firing on page load

    • Multiple tags competing for resources
    • No prioritization
  3. Large third-party scripts

How to fix:

// Use GTM async loading:
// Ensure GTM container loaded asynchronously:
<script async src="https://www.googletagmanager.com/gtm.js?id=GTM-XXXXXXX"></script>

// Delay non-critical tags:
// In GTM, use Custom HTML tag with timeout:
<script>
  setTimeout(function() {
    // Load non-critical tags after 3 seconds
    dataLayer.push({ event: 'delay_load' });
  }, 3000);
</script>

// Use Tag Sequencing in GTM:
// 1. Open critical tag (e.g., GA4 page view)
// 2. Advanced Settings → Tag Sequencing
// 3. Set non-critical tags to fire after this tag

Platform-Specific Guides

Platform Guide
Shopify Tag Validation on Shopify
WordPress Tag Validation on WordPress
Squarespace Tag Validation on Squarespace
Wix Tag Validation on Wix
Webflow Tag Validation on Webflow

Further Reading

// SYS.FOOTER