Skip to content

Commit f490b01

Browse files
authored
feat(frontend): Add Vercel Analytics and Speed Insights (#10904)
## Summary - Added Vercel Analytics for tracking page views and user interactions - Added Vercel Speed Insights for monitoring Web Vitals and performance metrics - Fixed incorrect placement of SpeedInsights component (was between html and head tags) ## Changes - Import Analytics and SpeedInsights components from Vercel packages - Place both components correctly within the body tag - Ensure proper HTML structure and Next.js best practices ## Test plan - [x] Verify components are imported correctly - [x] Confirm no HTML validation errors - [x] Test that analytics work when deployed to Vercel - [x] Verify Speed Insights metrics are being collected
1 parent e70c970 commit f490b01

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

autogpt_platform/frontend/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
"@tanstack/react-query": "5.85.3",
5555
"@tanstack/react-table": "8.21.3",
5656
"@types/jaro-winkler": "0.2.4",
57+
"@vercel/analytics": "1.5.0",
58+
"@vercel/speed-insights": "1.2.0",
5759
"@xyflow/react": "12.8.3",
5860
"boring-avatars": "1.11.2",
5961
"class-variance-authority": "0.7.1",

autogpt_platform/frontend/pnpm-lock.yaml

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autogpt_platform/frontend/src/app/layout.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import TallyPopupSimple from "@/components/TallyPopup";
99
import { GoogleAnalytics } from "@/components/analytics/google-analytics";
1010
import { Toaster } from "@/components/molecules/Toast/toaster";
1111
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
12+
import { SpeedInsights } from "@vercel/speed-insights/next";
13+
import { Analytics } from "@vercel/analytics/next";
1214

1315
export const metadata: Metadata = {
1416
title: "AutoGPT Platform",
@@ -42,6 +44,8 @@ export default async function RootLayout({
4244
<div className="flex min-h-screen flex-col items-stretch justify-items-stretch">
4345
{children}
4446
<TallyPopupSimple />
47+
<SpeedInsights />
48+
<Analytics />
4549

4650
{/* React Query DevTools is only available in development */}
4751
{process.env.NEXT_PUBLIC_REACT_QUERY_DEVTOOL && (

0 commit comments

Comments
 (0)