Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ SUPABASE_SERVICE_ROLE_KEY=your-service-role-key

# Random secret for Vercel cron authentication — set same value in Vercel env vars
CRON_SECRET=your-random-secret

# Google Analytics 4 Measurement ID (format: G-XXXXXXXXXX)
# Get from analytics.google.com -> Admin -> Data Streams -> your stream -> Measurement ID
NEXT_PUBLIC_GA_MEASUREMENT_ID=G-CCRK2NRGSL
Comment on lines +17 to +19
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Don't ship a real-looking Measurement ID in the example file.

G-CCRK2NRGSL reads like a real GA4 stream ID rather than a placeholder. Anyone cloning/forking without overriding .env.local will pollute your GA property with their dev traffic (and you'll inherit their PII-adjacent data). The comment on line 17 already specifies the placeholder format — use it.

🔧 Proposed fix
-NEXT_PUBLIC_GA_MEASUREMENT_ID=G-CCRK2NRGSL
+NEXT_PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX

If G-CCRK2NRGSL is indeed your production stream, consider rotating it and scrubbing git history since .env.local.example is public.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Google Analytics 4 Measurement ID (format: G-XXXXXXXXXX)
# Get from analytics.google.com -> Admin -> Data Streams -> your stream -> Measurement ID
NEXT_PUBLIC_GA_MEASUREMENT_ID=G-CCRK2NRGSL
# Google Analytics 4 Measurement ID (format: G-XXXXXXXXXX)
# Get from analytics.google.com -> Admin -> Data Streams -> your stream -> Measurement ID
NEXT_PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.env.local.example around lines 17 - 19, Replace the real-looking GA4
Measurement ID in the example env variable NEXT_PUBLIC_GA_MEASUREMENT_ID with a
neutral placeholder (e.g., G-XXXXXXXXXX or an empty placeholder) so the example
file does not contain an actual stream ID; if the current value is a production
ID, rotate the ID and remove it from history.

4 changes: 4 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Metadata, Viewport } from 'next'
import { DM_Sans, Plus_Jakarta_Sans, JetBrains_Mono } from 'next/font/google'
import { ThemeProvider } from 'next-themes'
import { Analytics } from '@vercel/analytics/next'
import { GoogleAnalytics } from '@next/third-parties/google'
Comment thread
coderabbitai[bot] marked this conversation as resolved.
import { FaviconInit } from '@/components/ui/FaviconInit'
import './globals.css'

Expand Down Expand Up @@ -94,6 +95,9 @@ export default function RootLayout({
suppressHydrationWarning
className={`${dmSans.variable} ${plusJakartaSans.variable} ${jetbrainsMono.variable}`}
>
{process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID && (
<GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID} />
)}
<body className="bg-background text-foreground font-sans min-h-screen antialiased">
<ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
<script
Expand Down
2 changes: 1 addition & 1 deletion app/privacy/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function PrivacyPage() {
</section>
<section>
<h2 className="font-semibold text-base mb-2 text-[var(--text-primary)]">Third parties</h2>
<p>We use Supabase for authentication and data storage, and Vercel for hosting. Both are SOC 2 compliant. Analytics are provided by Vercel Analytics (privacy-friendly, no cookies).</p>
<p>We use Supabase for authentication and data storage, and Vercel for hosting. Both are SOC 2 compliant. We use Vercel Analytics (no cookies) and Google Analytics 4 for usage metrics. Google Analytics sets cookies (_ga, _ga_*) and transmits anonymized usage data to Google. You can opt out via <a href="https://tools.google.com/dlpage/gaoptout" target="_blank" rel="noopener noreferrer" className="text-[var(--accent)]">Google&apos;s opt-out tool</a>.</p>
</section>
<section>
<h2 className="font-semibold text-base mb-2 text-[var(--text-primary)]">Your rights</h2>
Expand Down
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.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"test:watch": "vitest"
},
"dependencies": {
"@next/third-parties": "^16.2.4",
"@react-three/fiber": "^8.18.0",
"@supabase/ssr": "^0.5.0",
"@supabase/supabase-js": "^2.45.0",
Expand All @@ -34,6 +35,7 @@
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/three": "^0.184.0",
"@vitejs/plugin-react": "^6.0.1",
"autoprefixer": "^10.0.1",
"eslint": "^8",
Expand All @@ -42,7 +44,6 @@
"postcss": "^8",
"tailwindcss": "^3.4.0",
"typescript": "^5",
"vitest": "^4.1.4",
"@types/three": "^0.184.0"
"vitest": "^4.1.4"
}
}