Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Refactor Google Tag Manager integration in layout component

Bill Yang04c5e7678ef2
diff --git a/client/src/app/layout.tsx b/client/src/app/layout.tsx
index 86c392d24..5dbff6dfa 100644
--- a/client/src/app/layout.tsx
+++ b/client/src/app/layout.tsx
@@ -21,30 +21,26 @@ export default function RootLayout({ children }: { children: React.ReactNode })
return (
<html lang="en" className="dark">
- {IS_CLOUD && (
- <head>
- <Script id="gtm-script" strategy="afterInteractive">
- {`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
+ <head>
+ <Script id="gtm-script" strategy="afterInteractive">
+ {`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KWZ8K6K9');`}
- </Script>
- </head>
- )}
+ </Script>
+ </head>
<ReactScan />
<TooltipProvider>
<body className={cn("bg-background text-foreground h-full", inter.className)}>
- {IS_CLOUD && (
- <noscript>
- <iframe
- src="https://www.googletagmanager.com/ns.html?id=GTM-KWZ8K6K9"
- height="0"
- width="0"
- style={{ display: "none", visibility: "hidden" }}
- />
- </noscript>
- )}
+ <noscript>
+ <iframe
+ src="https://www.googletagmanager.com/ns.html?id=GTM-KWZ8K6K9"
+ height="0"
+ width="0"
+ style={{ display: "none", visibility: "hidden" }}
+ />
+ </noscript>
<QueryProvider>
<OrganizationInitializer />
<AuthenticationGuard />