feat: add google gtag

main
guofei 2024-10-28 12:09:04 +08:00
parent 06c0ed4848
commit 46e7042ad6
1 changed files with 12 additions and 0 deletions

View File

@ -35,6 +35,18 @@ function RootLayout({ children }: { children: ReactNode }): ReactElement {
`,
}}
/>
{/* google */}
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3VNFGQNP7Z" />
<script
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-3VNFGQNP7Z');
`,
}}
/>
</body>
</html>
);