Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
.next/
.env.local
.env*
.DS_Store
next-env.d.ts
Expand Down
34 changes: 34 additions & 0 deletions app/hooks/TrackPage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use client";

import { useEffect } from "react";

type TrackPageProps = {
page: string;
};

export default function useTrackPage({ page }: TrackPageProps) {
useEffect(() => {
const trackPage = async () => {
try {
await fetch("/api/track", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
event_type: "page_view",
payload: {
page,
url: window.location.href,
userAgent: navigator.userAgent,
},
}),
});
} catch (error) {
console.error("Page tracking failed:", error);
}
};

trackPage();
}, [page]);
}
5 changes: 5 additions & 0 deletions app/signup/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
"use client";

import Image from "next/image";
import EmailSignupForm from "./EmailSignupForm";
import useTrackPage from "../hooks/TrackPage";

export default function SignupPage()
{
useTrackPage({page:"signup"});

return (
<main className="min-h-screen bg-background text-foreground pt-36">
{/* Page content */}
Expand Down
Empty file removed middleware.ts
Empty file.
48 changes: 24 additions & 24 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@playwright/test": "^1.49.0",
"@radix-ui/react-label": "^2.1.8",
"@radix-ui/react-slot": "^1.2.4",
"@supabase/supabase-js": "^2.97.0",
"@supabase/supabase-js": "^2.98.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.464.0",
Expand Down