Tag Conflicts | Blue Frog Docs

Tag Conflicts

Understanding and fixing tracking tag conflicts that cause duplicate or missing data.

Tag Conflicts

What This Means

Tag conflicts occur when multiple tracking implementations interfere with each other, causing duplicate data, missing events, or incorrect attribution. This commonly happens when using both native platform integrations and Google Tag Manager, or when multiple team members implement tracking independently.

Impact:

  • Duplicate transactions/conversions
  • Inflated or deflated metrics
  • Incorrect attribution
  • Data discrepancies between platforms
  • Wasted ad spend on incorrect optimization

How to Diagnose

Check for Duplicate Tags

Google Tag Assistant:

  1. Install Tag Assistant
  2. Navigate through your site
  3. Look for multiple GA4/UA tags loading

Browser DevTools:

  1. Open Network tab (F12)
  2. Filter by "collect" or "analytics"
  3. Count requests - multiple per action indicates duplicates

Check Data Layer

// Run in browser console
console.log(window.dataLayer);

// Look for duplicate events
window.dataLayer.filter(item => item.event === 'purchase');

Compare Platform Data

  • Compare GA4 conversions to platform conversions
  • Compare Meta Pixel events to actual sales
  • If numbers are 2x or 0.5x, likely duplicate or conflict

General Fixes

1. Consolidate to Single Implementation

Choose one method:

  • GTM for all tracking (recommended)
  • Native integrations only
  • Custom code only

Remove duplicates:

<!-- Remove if using GTM -->
<!-- <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXX"></script> -->

<!-- Keep only GTM container -->
<script async src="https://www.googletagmanager.com/gtm.js?id=GTM-XXXXX"></script>

2. Audit All Tracking Sources

Create an inventory:

Platform Source Status
GA4 GTM Keep
GA4 Native app Remove
GA4 Theme code Remove
Meta Pixel GTM Keep
Meta Pixel CAPI Keep

3. Fix GTM Container Conflicts

Avoid multiple containers with same tags:

// Check for multiple GTM containers
document.querySelectorAll('script[src*="gtm.js"]');

Merge containers if needed:

  • Export tags from duplicate container
  • Import into primary container
  • Remove duplicate container

4. Handle Native + GTM Conflicts

If you must use both:

// In GTM, check if native already fired
<script>
  if (!window._nativeGA4Loaded) {
    // Fire GTM GA4 tag
  }
</script>

5. Fix Event Timing Issues

Use trigger sequencing:

  • Ensure data layer populated before tags fire
  • Use "All Pages" trigger with conditions
  • Add delays for async data

6. Deduplicate Conversion Tracking

Use transaction ID:

// GTM data layer
dataLayer.push({
  'event': 'purchase',
  'transaction_id': '12345', // Unique order ID
  'value': 99.99
});

GA4 and ad platforms will dedupe based on transaction ID.

Platform-Specific Guides

Platform Common Conflict
Shopify Native GA + GTM GA + App GA
WordPress Plugin GA + Theme GA + GTM GA
Wix Native analytics + custom code
BigCommerce Built-in + apps + custom

Shopify Conflict Resolution

  1. Go to Settings > Customer events
  2. Remove custom pixels if using GTM
  3. Or disable GTM tags if using native

WordPress Conflict Resolution

  1. Audit all plugins for analytics
  2. Deactivate duplicate tracking plugins
  3. Keep one source of truth

Common Conflict Scenarios

Scenario 1: Double-Counting Purchases

Symptom: GA4 shows 2x actual orders. Cause: GTM purchase tag + native checkout tracking. Fix: Disable native, use GTM only.

Scenario 2: Missing Events

Symptom: Add to cart events not firing. Cause: JavaScript error in one implementation breaks both. Fix: Fix JS error or remove conflicting code.

Scenario 3: Attribution Mismatch

Symptom: Meta reports different conversions than GA4. Cause: Different implementations with different timing. Fix: Unify tracking through GTM.

Prevention

Establish Tracking Governance

  1. Document all tracking implementations
  2. Designate tracking owner
  3. Require approval for new tags
  4. Regular audits (monthly)

Use GTM Workspaces

  • Separate workspaces for different teams
  • Review before publishing
  • Version control and rollback

Verification

After fixing:

  1. Clear browser cache and cookies
  2. Complete test transaction
  3. Check GA4 DebugView - one event per action
  4. Check Meta Events Manager - matching conversions
  5. Compare to actual platform data

Further Reading

// SYS.FOOTER