mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
Add google analytics scripts
This commit is contained in:
+26
-1
@@ -1,4 +1,4 @@
|
|||||||
import Document from 'next/document';
|
import Document, { Html, Head, Main, NextScript } from 'next/document';
|
||||||
import { ServerStyleSheet } from 'styled-components';
|
import { ServerStyleSheet } from 'styled-components';
|
||||||
|
|
||||||
class Doc extends Document {
|
class Doc extends Document {
|
||||||
@@ -26,6 +26,31 @@ class Doc extends Document {
|
|||||||
sheet.seal();
|
sheet.seal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<Html>
|
||||||
|
<Head>
|
||||||
|
<script async src='https://www.googletagmanager.com/gtag/js?id=G-FMD81GLKS3'></script>
|
||||||
|
<script
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: `
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
|
||||||
|
gtag('config', 'G-FMD81GLKS3');
|
||||||
|
`
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Head>
|
||||||
|
<body>
|
||||||
|
<Main />
|
||||||
|
<NextScript />
|
||||||
|
</body>
|
||||||
|
</Html>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Doc;
|
export default Doc;
|
||||||
|
|||||||
Reference in New Issue
Block a user