Skip to content

Commit

Permalink
feat(portal): integrate vercel web analytics
Browse files Browse the repository at this point in the history
This will automatically start tracking
visitors and page views with Web Analytics

Changes:
- Create a root `layout.tsx`.
- Add to it the Analytics component.
  • Loading branch information
Tzal3x committed Jan 13, 2025
1 parent f3561a6 commit f6c425b
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 21 deletions.
115 changes: 94 additions & 21 deletions portal/pnpm-lock.yaml

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

22 changes: 22 additions & 0 deletions portal/server/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

import { Analytics } from "@vercel/analytics/next";

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<head>
<title>Next.js</title>
</head>
<body>
{children}
<Analytics />
</body>
</html>
);
}
1 change: 1 addition & 0 deletions portal/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"dependencies": {
"@sentry/nextjs": "^8",
"@sentry/node": "^8.38.0",
"@vercel/analytics": "^1.4.1",
"@vercel/edge-config": "^1.4.0",
"common": "workspace:common",
"next": "14.2.15"
Expand Down

0 comments on commit f6c425b

Please sign in to comment.