Fix Tracking Events Not Firing on SharePoint | OpsBlu Docs

Fix Tracking Events Not Firing on SharePoint

Diagnose and fix GA4, GTM, and pixel events not firing on SharePoint. Covers installation verification, SharePoint-specific issues, and debugging steps.

For universal debugging steps, see Global Events Not Firing Guide

Quick Diagnosis

1. Is the Tracking Script Loaded?

Open browser DevTools (F12) → Console and run:

// Check GTM
console.log('GTM:', typeof google_tag_manager !== 'undefined' ? 'Loaded' : 'NOT loaded');

// Check GA4 (gtag)
console.log('gtag:', typeof gtag === 'function' ? 'Loaded' : 'NOT loaded');

// Check Meta Pixel
console.log('Meta Pixel:', typeof fbq === 'function' ? 'Loaded' : 'NOT loaded');

// Check data layer
console.log('dataLayer:', window.dataLayer);

2. Are Events Being Pushed?

Monitor data layer pushes in real-time:

(function() {
  var orig = window.dataLayer.push;
  window.dataLayer.push = function() {
    console.log('DL push:', arguments[0]);
    return orig.apply(window.dataLayer, arguments);
  };
})();

Perform the action that should trigger an event (submit a form, click a button, etc.) and watch the console for output.

3. Check the Network Tab

DevTools → Networkfilter for:

  • googletagmanager.comGTM container loading
  • google-analytics.com/g/collectGA4 event hits
  • facebook.com/trMeta Pixel events

If these requests are missing, the tracking scripts aren't loading. If they appear but events are wrong, the issue is in your tag/trigger configuration.

SharePoint-Specific Issues

  • Modern SharePoint Online blocks custom scripts by default — enable in admin center (takes up to 24 hours)
  • SPFx extensions have a different lifecycle than inline scripts — ensure your extension targets the correct page scope
  • SharePoint CDN caching can delay updates by hours
  • Classic vs. Modern pages use different injection methods — a solution for Classic won't work on Modern and vice versa

Common Fixes

Ad Blockers

Ad blockers (uBlock Origin, AdBlock Plus, Brave browser) block GTM, GA4, and Meta Pixel by default. Test in an incognito/private window with extensions disabled to rule this out.

Consent/Cookie Banners

If you have a consent management platform (CMP), it may block tracking scripts until the user accepts cookies. Check your CMP configuration to ensure analytics scripts are allowed to fire (or that they fire correctly after consent is granted).

JavaScript Errors

A JavaScript error earlier in the page can prevent GTM and tracking scripts from executing. Check the browser Console for red errors — fix those first.

GTM Container Not Published

Changes in GTM only take effect after you click Submit → Publish. If you've added tags but haven't published, they won't fire on your live site.

Debugging Tools

  • GTM Preview Mode — click Preview in GTM to see which tags fire and which don't, with detailed reasons
  • GA4 DebugView — Admin → Data Display → DebugView shows events in real-time (requires debug mode enabled)
  • Meta Pixel Helper — Chrome extension that shows pixel fires and errors on any page
  • Tag Assistanttagassistant.google.com for verifying Google tags

Still Not Working?