Skip to content

Commit

Permalink
增加google统计变量,支持统计网页访问
Browse files Browse the repository at this point in the history
  • Loading branch information
fatwang2 committed Mar 28, 2024
1 parent 3a6b8cb commit ea13146
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 73 deletions.
124 changes: 53 additions & 71 deletions web/package-lock.json

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

4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint": "next lint"
},
"dependencies": {
"@next/third-parties": "^14.0.4",
"@next/third-parties": "^14.1.4",
"@radix-ui/react-popover": "^1.0.7",
"@tailwindcss/forms": "^0.5.7",
"@upstash/ratelimit": "^1.0.0",
Expand All @@ -21,7 +21,7 @@
"lucide-react": "^0.309.0",
"mdast-util-from-markdown": "^2.0.0",
"nanoid": "^5.0.4",
"next": "14.0.4",
"next": "^14.1.4",
"react": "^18",
"react-dom": "^18",
"react-markdown": "^9.0.1",
Expand Down
3 changes: 3 additions & 0 deletions web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import { ReactNode } from "react";
import { GoogleAnalytics } from '@next/third-parties/google'


const inter = Inter({ subsets: ["latin"] });

Expand All @@ -15,6 +17,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS || ''} />
</html>
);
}

0 comments on commit ea13146

Please sign in to comment.