add Google tag for Google analytics

add Google tag for Google analytics
This commit is contained in:
Jihua Peng 2023-04-16 23:29:11 +08:00
parent af30a8b79e
commit 275b9b7882

View File

@ -44,6 +44,15 @@ export default function RootLayout({
rel="stylesheet" rel="stylesheet"
></link> ></link>
<script src="/serviceWorkerRegister.js" defer></script> <script src="/serviceWorkerRegister.js" defer></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1FKGPYXXMT"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-1FKGPYXXMT');
</script>
</head> </head>
<body>{children}</body> <body>{children}</body>
</html> </html>