Skip to content

Commit

Permalink
Switch to Next-native Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
krishaamer committed Apr 26, 2024
1 parent a588e2a commit e486f7e
Showing 3 changed files with 28 additions and 24 deletions.
14 changes: 7 additions & 7 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { Metadata } from "next";
import { GeistMono } from "geist/font/mono";
import { GeistSans } from "geist/font/sans";
import { Analytics } from "@vercel/analytics/react";
import { Analytics as NextAnalytics } from "@vercel/analytics/react";
import { Toaster } from "@/components/ui/toaster";
import { AI } from "./action";
import { Providers } from "@/components/providers";
import { Hotjar } from "nextjs-hotjar";
//import { Hotjar } from "nextjs-hotjar";
//import { init as initFullStory, FullStory } from "@fullstory/browser";
import { GoogleAnalytics } from "nextjs-google-analytics";
import { GoogleAnalytics } from "@next/third-parties/google";
import "./globals.css";

const meta = {
@@ -61,7 +61,6 @@ export default function RootLayout({
}: Readonly<{
children: React.ReactNode;
}>) {

/*
initFullStory({ orgId: "o-1XVGW4-na1" });
@@ -71,12 +70,12 @@ export default function RootLayout({
myprop: "somedata",
},
});
<Hotjar id="4956812" sv={6} />;
<GoogleAnalytics trackPageViews />
*/

return (
<html lang="en" suppressHydrationWarning>
<GoogleAnalytics trackPageViews />
<Hotjar id="4956812" sv={6} />;
<body
className={`font-sans antialiased ${GeistSans.variable} ${GeistMono.variable}`}
>
@@ -91,8 +90,9 @@ export default function RootLayout({
{children}
</Providers>
</AI>
<Analytics />
</body>
<NextAnalytics />
<GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID || ""} />
</html>
);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
},
"dependencies": {
"@fullstory/browser": "^2.0.4",
"@next/third-parties": "^14.2.3",
"@pinecone-database/pinecone": "^2.2.0",
"@polygon.io/client-js": "^7.3.2",
"@radix-ui/colors": "^3.0.0",
@@ -45,7 +46,6 @@
"next": "14.2.3",
"next-auth": "5.0.0-beta.16",
"next-themes": "^0.3.0",
"nextjs-google-analytics": "^2.3.3",
"nextjs-hotjar": "^1.2.0",
"openai": "^4.38.5",
"react": "^18.2.0",
36 changes: 20 additions & 16 deletions pnpm-lock.yaml

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

0 comments on commit e486f7e

Please sign in to comment.