Skip to content

Commit 84e3488

Browse files
committed
Add GA
1 parent 7b7a058 commit 84e3488

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

app/layout.jsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import Script from "next/script";
12
import "./globals.css";
23

4+
const GA_MEASUREMENT_ID = "G-0WGHC5ZGJ1";
5+
36
export const metadata = {
47
title: "Patch Notation Tool",
58
description: "Drag-and-drop Eurorack and VCV Rack patch notation using Patch & Tweak inspired symbols."
@@ -8,7 +11,21 @@ export const metadata = {
811
export default function RootLayout({ children }) {
912
return (
1013
<html lang="en">
11-
<body>{children}</body>
14+
<body>
15+
<Script
16+
src={`https://www.googletagmanager.com/gtag/js?id=${GA_MEASUREMENT_ID}`}
17+
strategy="afterInteractive"
18+
/>
19+
<Script id="google-analytics" strategy="afterInteractive">
20+
{`
21+
window.dataLayer = window.dataLayer || [];
22+
function gtag(){dataLayer.push(arguments);}
23+
gtag('js', new Date());
24+
gtag('config', '${GA_MEASUREMENT_ID}');
25+
`}
26+
</Script>
27+
{children}
28+
</body>
1229
</html>
1330
);
1431
}

0 commit comments

Comments
 (0)