Skip to content

Commit

Permalink
Set right google analytics measurement id
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Amursky committed Nov 17, 2023
1 parent dc3da65 commit c14cbf8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ import Script from "next/script";
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<Script async src="https://www.googletagmanager.com/gtag/js?id=G-EVF4JW4KED" />
<Script
async
src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID}`}
/>
<Script id="gtag">{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-EVF4JW4KED');
gtag('config', ${process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID});
`}</Script>
<body>{children}</body>
</html>
Expand Down

0 comments on commit c14cbf8

Please sign in to comment.