Google tag manager or google analytics with Base44?

I’m trying to add Google Tag Manager (GTM) into my Base44 React project. I copied the standard GTM snippet and injected it in Layout.js using:

<script dangerouslySetInnerHTML={{ __html: `...gtm code...` }} /> 

But GTM doesn’t fire — I don’t see my container ID (GTM-5G9G9NV8) in the console, and DebugView shows nothing.

From what I can tell, the issue is that scripts added with innerHTML aren’t executed the same way as inline scripts. So GTM never actually loads.

Has anyone solved this in Base44? Do you recommend dynamically appending <script src="https://www.googletagmanager.com/gtm.js?id=..."> in a useEffect, or is there a Base44-native way to add third-party scripts to <head> and <body>?

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board
💡

Feature Request

Date

5 months ago

Author

omj96

Subscribe to post

Get notified by email when there are changes.