Skip to content

Commit

Permalink
fix: GA
Browse files Browse the repository at this point in the history
  • Loading branch information
MakinoharaShoko committed Sep 29, 2024
1 parent d8ca0e8 commit 2541c25
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { notFound } from 'next/navigation'
import { i18n } from '../../i18n'
import Footer from './components/Footer/Footer'
import Navbar from './components/Navbar/Navbar'
import Script from 'next/script'
import { GoogleAnalytics } from '@next/third-parties/google'

const notoSansSC = Noto_Sans_SC({
subsets: ['latin'],
Expand All @@ -27,26 +27,14 @@ export default async function LangLayout({ children, params: { locale } }

return (
<html lang={locale} className={notoSansSC.className}>
<head>
{/*Google tag (gtag.js)*/}
<Script src="https://www.googletagmanager.com/gtag/js?id=G-6XPF6Q2WY0" />
<Script id="google-analytics">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '6XPF6Q2WY0');
`}
</Script>
</head>
<body>
<NextIntlClientProvider locale={locale} messages={locales}>
<Navbar />
{children}
<Footer />
</NextIntlClientProvider>
<GoogleAnalytics gaId="G-6XPF6Q2WY0" />
</body>
</html>
)
}
}

0 comments on commit 2541c25

Please sign in to comment.