Skip to content

Commit

Permalink
adding GTM (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
rupali-codes authored Jan 15, 2023
1 parent 4ceb5b4 commit 748b838
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
import { Html, Head, Main, NextScript } from 'next/document'
import { Html, Head, Main, NextScript } from "next/document";

export default function Document() {
return (
<Html lang="en">
<Head />
<Head>
<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-PC5DFJG');`,
}}
/>
</Head>
<body>
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-PC5DFJG"
height="0"
width="0"
style={{ display: "none", visibility: "hidden" }}
></iframe>
</noscript>
<Main />
<NextScript />
</body>
</Html>
)
);
}

1 comment on commit 748b838

@vercel
Copy link

@vercel vercel bot commented on 748b838 Jan 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

linkshub – ./

linkshub-git-main-rupali-codes.vercel.app
linkshub.vercel.app
linkshub-rupali-codes.vercel.app

Please sign in to comment.