Skip to content

Commit

Permalink
added google tag manager
Browse files Browse the repository at this point in the history
  • Loading branch information
stiemsdev committed Jul 16, 2024
1 parent 88f7004 commit d2d34ac
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions src/pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ class MyDocument extends Document {
return (
<Html lang="en">
<Head>
{/* Google Tag Manager */}
<script
dangerouslySetInnerHTML={{
__html: `
(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-TVWD427C');
`,
}}
/>
{/* End Google Tag Manager */}
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta name="author" content="LTO Network" />
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon/favicon-32x32.png" />
Expand All @@ -32,19 +45,8 @@ class MyDocument extends Document {
<script
async
src='https://www.googletagmanager.com/gtag/js?id=G-MF9PZPR17H'
/>
<script
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-MF9PZPR17H');
`,
}}
/>


/>

{/* Google Fonts */}
<link
href="https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900&display=swap"
Expand All @@ -69,6 +71,16 @@ class MyDocument extends Document {
</Head>

<body>
<noscript>
{/* Google Tag Manager (noscript) */}
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-TVWD427C"
height="0"
width="0"
style={{ display: 'none', visibility: 'hidden' }}
/>
{/* End Google Tag Manager (noscript) */}
</noscript>
<Main />
<NextScript />
</body>
Expand Down

0 comments on commit d2d34ac

Please sign in to comment.