remove duplicate google tag manager (#122)

This commit is contained in:
Ritesh Kumar authored and GitHub committed 2019-07-22 19:11:02 +05:30
1 parent 0ca0d17ead
commit c89ab5ff4a
1 file changed
-24
-24
View File
@@ -7,22 +7,6 @@ interface DocumentProps {
hydrationScript: React.ReactChild;
}
function trackingScript() {
// @ts-ignore
if (window.dataLayer) return;
// @ts-ignore
window.dataLayer = window.dataLayer || [];
function gtag() {
// @ts-ignore
window.dataLayer.push(arguments);
}
// @ts-ignore
gtag("js", new Date());
// @ts-ignore
gtag("config", "UA-60624235-8");
}
export default class MyDocument extends Document<DocumentProps> {
static getInitialProps({ renderPage }) {
const page = renderPage();
@@ -54,14 +38,6 @@ export default class MyDocument extends Document<DocumentProps> {
<Main />
{hydrationScript}
<NextScript />
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-60624235-8"
/>
<script>
<>{IN_BROWSER && trackingScript()}</>
</script>
</body>
</html>
);