Skip to content

Commit

Permalink
[www] Fix Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
SamChou19815 committed Oct 2, 2023
1 parent 859e355 commit 01a3bb8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/www/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ export default function RootLayout({ children }: { children: React.ReactNode })
return (
<html lang="en">
{process.env.NODE_ENV === "production" && (
// biome-ignore lint/security/noDangerouslySetInnerHtml: Necessary for GA script injection
<Script id="google-analytics" dangerouslySetInnerHTML={{ __html: GA_INLINE_SCRIPT }} />
<Script src={`https://www.googletagmanager.com/gtag/js?id=${GA_ID}`} />
)}
{process.env.NODE_ENV === "production" && (
<Script id="google-analytics">{GA_INLINE_SCRIPT}</Script>
)}
<body>{children}</body>
</html>
Expand Down

0 comments on commit 01a3bb8

Please sign in to comment.