Skip to content

Commit

Permalink
ga: use @next/third-parties/google for Google Analytics
Browse files Browse the repository at this point in the history
No need to manually log pageview events (Enhanced Measurements is enabled).
  • Loading branch information
flsilva committed Feb 27, 2024
1 parent 5c18a6d commit 104e57b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 76 deletions.
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@mdx-js/loader": "3.0.0",
"@mdx-js/react": "3.0.0",
"@next/mdx": "14.1.0",
"@next/third-parties": "14.1.0",
"@tailwindcss/forms": "0.5.7",
"@tailwindcss/typography": "0.5.10",
"autoprefixer": "10.4.17",
Expand Down
7 changes: 2 additions & 5 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import './globals.css';
import { Suspense } from 'react';
import type { Metadata, Viewport } from 'next';
import { Inter } from 'next/font/google';
import { GaNextScriptNavigation } from '@/features/shared/routing/GoogleAnalytics';
import { GoogleAnalytics } from '@next/third-parties/google';
import { InstallPwaProvider } from '@/features/shared/ui/pwa/InstallPwaProvider';

export const viewport: Viewport = {
Expand Down Expand Up @@ -149,9 +148,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
<html lang="en" className="h-full antialiased">
<body className={`${inter.className} flex flex-col h-full`}>
<InstallPwaProvider>{children}</InstallPwaProvider>
<Suspense>
<GaNextScriptNavigation gaId="G-C6TYTB01NE" />
</Suspense>
<GoogleAnalytics gaId="G-C6TYTB01NE" />
</body>
</html>
);
Expand Down
71 changes: 0 additions & 71 deletions src/features/shared/routing/GoogleAnalytics.tsx

This file was deleted.

0 comments on commit 104e57b

Please sign in to comment.