feat(analytics): Add Firebase Analytics integration with page tracking
- Initialize Firebase Analytics with configuration and client-side setup - Create GoogleAnalytics component to track page views on route changes - Add analytics utility functions for tracking custom events (button clicks, form submissions, link clicks, searches) - Integrate GoogleAnalytics component into home, not-found, and marketing layouts with Suspense boundary - Add firebase dependency to package.json - Enable automatic page view tracking with pathname and search parameters
This commit is contained in:
@@ -5,6 +5,7 @@ import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { Suspense } from "react";
|
||||
import { ToastContainer, Zoom } from "react-toastify";
|
||||
import GoogleAnalytics from "../_components/GoogleAnalytics";
|
||||
import NavigationBar from "../_components/NavigationBar";
|
||||
import "../globals.css";
|
||||
const geistSans = Geist({
|
||||
@@ -136,6 +137,10 @@ export default async function RootLayout({
|
||||
pauseOnHover
|
||||
/>
|
||||
|
||||
<Suspense>
|
||||
<GoogleAnalytics />
|
||||
</Suspense>
|
||||
|
||||
<div className="container px-4 m-auto flex-grow">{children}</div>
|
||||
<footer>
|
||||
<div className="relative z-10 container px-4 py-4 m-auto flex flex-col justify-center items-center ">
|
||||
|
||||
Reference in New Issue
Block a user