Skip to content

Commit

Permalink
chore(frontend): add gtag manager snippet (#1467)
Browse files Browse the repository at this point in the history
* chore(frontend): add gtag manager snippet

* fix(frontend): fix layout linting error
  • Loading branch information
mohab-sameh authored Jan 28, 2025
1 parent 0d14969 commit 656fefd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions apps/frontend/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ export default async function RootLayout({
n&&j.setAttribute('nonce',n.nonce||n.getAttribute('nonce'));f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-K32HQ25J');`}
</Script>
<Script id="gtm">
{`(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-PBSBXXDS');`}
</Script>
<script dangerouslySetInnerHTML={{ __html: dynamicFavicon }} />
<script dangerouslySetInnerHTML={{ __html: themeScript }} />
<style
Expand Down Expand Up @@ -60,6 +67,16 @@ export default async function RootLayout({
</Script>
</head>
<body>
{/* Google Tag Manager (noscript) */}
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-PBSBXXDS"
height="0"
width="0"
style={{ display: "none", visibility: "hidden" }}
/>
</noscript>
{/* End Google Tag Manager (noscript) */}
{children}
<Analytics />
</body>
Expand Down

0 comments on commit 656fefd

Please sign in to comment.