Skip to content

Commit

Permalink
ga
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Oct 14, 2024
1 parent 17f511a commit 24a26a3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/www/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { siteConfig } from '@/config/site';
import { fontSans } from '@/lib/fonts';

import '@/styles/globals.css';
import { GA } from '@/components/analytics/ga';

export const metadata: Metadata = {
authors: [
Expand Down Expand Up @@ -103,6 +104,7 @@ export default function RootLayout({ children }: RootLayoutProps) {
</Providers>
<TailwindIndicator />

<GA />
<Toaster />
</body>
</html>
Expand Down
11 changes: 11 additions & 0 deletions apps/www/src/components/analytics/ga.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { FC } from 'react';

import { GoogleAnalytics } from '@next/third-parties/google';

export const GA: FC = () => {
if (!process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID) {
return null;
}

return <GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID} />;
};
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"env": [
"COMPONENTS_BASE_URL",
"NEXT_PUBLIC_APP_URL",
"NEXT_PUBLIC_GA_MEASUREMENT_ID",
"NODE_ENV",
"npm_config_user_agent",
"https_proxy"
Expand Down

0 comments on commit 24a26a3

Please sign in to comment.