diff --git a/app/layout.tsx b/app/layout.tsx index c770d0a..0c285fe 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -5,20 +5,11 @@ import { Analytics } from "@vercel/analytics/react"; import { Toaster } from "@/components/ui/toaster"; import { AI } from "./action"; import { Providers } from "@/components/providers"; -import Hotjar from "@hotjar/browser"; +import { Hotjar } from "nextjs-hotjar"; import { init as initFullStory, FullStory } from "@fullstory/browser"; import { GoogleAnalytics } from "nextjs-google-analytics"; import "./globals.css"; -const siteId = 4956812; -const hotjarVersion = 6; - -Hotjar.init(siteId, hotjarVersion); -Hotjar.init(siteId, hotjarVersion, { - debug: true, -}); -initFullStory({ orgId: "o-1XVGW4-na1" }); - const meta = { title: "綠濾", description: "See your money through the lens of sustainability", @@ -71,6 +62,8 @@ export default function RootLayout({ children: React.ReactNode; }>) { + initFullStory({ orgId: "o-1XVGW4-na1" }); + FullStory("trackEvent", { name: "Ziran Init", properties: { @@ -81,6 +74,7 @@ export default function RootLayout({ return ( + ; diff --git a/package.json b/package.json index b51d8fe..a9f0aa4 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ }, "dependencies": { "@fullstory/browser": "^2.0.4", - "@hotjar/browser": "^1.0.9", "@pinecone-database/pinecone": "^2.2.0", "@polygon.io/client-js": "^7.3.2", "@radix-ui/colors": "^3.0.0", @@ -47,6 +46,7 @@ "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", "react-chartjs-2": "^5.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 654ab34..24c8212 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,9 +11,6 @@ importers: '@fullstory/browser': specifier: ^2.0.4 version: 2.0.4 - '@hotjar/browser': - specifier: ^1.0.9 - version: 1.0.9 '@pinecone-database/pinecone': specifier: ^2.2.0 version: 2.2.0 @@ -116,6 +113,9 @@ importers: nextjs-google-analytics: specifier: ^2.3.3 version: 2.3.3(next@14.2.3(@babel/core@7.24.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.75.0))(react@18.2.0) + nextjs-hotjar: + specifier: ^1.2.0 + version: 1.2.0(next@14.2.3(@babel/core@7.24.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.75.0))(react@18.2.0) openai: specifier: ^4.38.5 version: 4.38.5(encoding@0.1.13) @@ -387,9 +387,6 @@ packages: '@fullstory/snippet@2.0.3': resolution: {integrity: sha512-EaCuTQSLv5FvnjHLbTxErn3sS1+nLqf1p6sA/c4PV49stBtkUakA0eLhJJdaw0WLdXyEzZXf86lRNsjEzrgGPw==} - '@hotjar/browser@1.0.9': - resolution: {integrity: sha512-n9akDMod8BLGpYEQCrHwlYWWd63c1HlhUSXNIDfClZtKYXbUjIUOFlNZNNcUxgHTCsi4l2i+SWKsGsO0t93S8w==} - '@humanwhocodes/config-array@0.13.0': resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} engines: {node: '>=10.10.0'} @@ -2727,6 +2724,12 @@ packages: next: '>=11.0.0' react: '>=17.0.0' + nextjs-hotjar@1.2.0: + resolution: {integrity: sha512-T0vBmModSXxAgv9e22T5aFbE1fhwuuAnq17ok+ZwnjnUePGL/p760Abag6NUhLLsJLE0wR7yASoRauFsi0AL0Q==} + peerDependencies: + next: '>=11.0.0' + react: '>=17.0.0' + node-domexception@1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} @@ -3788,8 +3791,6 @@ snapshots: '@fullstory/snippet@2.0.3': {} - '@hotjar/browser@1.0.9': {} - '@humanwhocodes/config-array@0.13.0': dependencies: '@humanwhocodes/object-schema': 2.0.3 @@ -6573,6 +6574,11 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + nextjs-hotjar@1.2.0(next@14.2.3(@babel/core@7.24.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.75.0))(react@18.2.0): + dependencies: + next: 14.2.3(@babel/core@7.24.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.75.0) + react: 18.2.0 + node-domexception@1.0.0: {} node-fetch@2.7.0(encoding@0.1.13):