"Googletagmanager.com" is still showing in uMatrix and uBlock plugins why? / how to remove?

AI-generated summary

In a discussion about why googletagmanager.com still appears in uMatrix and uBlock despite no analytics being installed, agemo initially suspected placeholder code or misconfiguration. Canapin suggested testing without extensions, which agemo planned to do, along with rebuilding the site. agemo later realized analytics might still be active due to improperly removed tracking code. Bas suggested checking custom scripts or themes, prompting agemo to discover and remove an old, forgotten Google Analytics snippet embedded in a custom component — explaining the persistent requests. The issue was resolved by removing the hardcoded script, confirming that Discourse’s core analytics aren’t automatically active unless explicitly configured or injected via custom code.

No analytics are installed on the discourse but uBlock and uMatrix in Firefox is still seeing and reporting two instances of googletagmanager.com

What’s going on here is it placeholder code?

Hi agemo,

I tested on a forum on which I don’t have Google Analytics configured, and I have no such request.

Do you still have a request to googletagmanager.com if you disable all your Firefox extensions?

Ok thanks. I’ll check extensions later and also run a rebuild and see if that makes a difference.

Analytics is core in discourse so what I did originally was remove the tracking code, assuming this would disable it, but turns out analytics is still reporting live data. Maybe I’ve done it wrong. How is it still reporting?

Could it be that you have it in a custom script/theme somewhere?

Ha ha of course, and I never thought of that. Found the below lurking in a custom component. I dunno why it’s there, must be an old inclusion from way back.

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=xxxxxxx"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-xxxxxxx-x');
</script>