Skip to content

Commit

Permalink
add gtag
Browse files Browse the repository at this point in the history
  • Loading branch information
ectodrop committed Dec 30, 2023
1 parent 5924f03 commit 864d4b9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/next';

import './globals.css'
import Script from 'next/script';

const inter = Inter({ subsets: ['latin'] })

Expand All @@ -21,6 +22,16 @@ export default function RootLayout({
<html lang="en">
<body className={inter.className} suppressHydrationWarning={true}>
{children}
<Script src="https://www.googletagmanager.com/gtag/js?id=G-DEL70N49ZN" />
<Script id="google-analytics">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-DEL70N49ZN');
`}
</Script>
<SpeedInsights />
<Analytics />
</body>
Expand Down

0 comments on commit 864d4b9

Please sign in to comment.