chore: Add Vercel Analytics integration and update package version

This commit is contained in:
ryanhex53 2024-11-10 13:50:22 +08:00
parent 5222c2b6a7
commit 6856061c32
3 changed files with 14 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import type { Metadata, Viewport } from "next";
import { SpeedInsights } from "@vercel/speed-insights/next"; import { SpeedInsights } from "@vercel/speed-insights/next";
import { getServerSideConfig } from "./config/server"; import { getServerSideConfig } from "./config/server";
import { GoogleTagManager, GoogleAnalytics } from "@next/third-parties/google"; import { GoogleTagManager, GoogleAnalytics } from "@next/third-parties/google";
import { Analytics } from "@vercel/analytics/react";
const serverConfig = getServerSideConfig(); const serverConfig = getServerSideConfig();
export const metadata: Metadata = { export const metadata: Metadata = {
@ -65,6 +66,7 @@ export default function RootLayout({
<GoogleAnalytics gaId={serverConfig.gaId} /> <GoogleAnalytics gaId={serverConfig.gaId} />
</> </>
)} )}
<Analytics />
</body> </body>
</html> </html>
); );

View File

@ -24,7 +24,7 @@
"@hello-pangea/dnd": "^16.5.0", "@hello-pangea/dnd": "^16.5.0",
"@next/third-parties": "^14.1.0", "@next/third-parties": "^14.1.0",
"@svgr/webpack": "^6.5.1", "@svgr/webpack": "^6.5.1",
"@vercel/analytics": "^0.1.11", "@vercel/analytics": "^1.3.2",
"@vercel/speed-insights": "^1.0.2", "@vercel/speed-insights": "^1.0.2",
"axios": "^1.7.5", "axios": "^1.7.5",
"clsx": "^2.1.1", "clsx": "^2.1.1",

View File

@ -2481,10 +2481,12 @@
"@typescript-eslint/types" "6.4.0" "@typescript-eslint/types" "6.4.0"
eslint-visitor-keys "^3.4.1" eslint-visitor-keys "^3.4.1"
"@vercel/analytics@^0.1.11": "@vercel/analytics@^1.3.2":
version "0.1.11" version "1.3.2"
resolved "https://registry.yarnpkg.com/@vercel/analytics/-/analytics-0.1.11.tgz#727a0ac655a4a89104cdea3e6925476470299428" resolved "https://mirrors.cloud.tencent.com/npm/@vercel/analytics/-/analytics-1.3.2.tgz#e7a8e22c83a7945e069960bab172308498b12b4e"
integrity sha512-mj5CPR02y0BRs1tN3oZcBNAX9a8NxsIUl9vElDPcqxnMfP0RbRc9fI9Ud7+QDg/1Izvt5uMumsr+6YsmVHcyuw== integrity sha512-n/Ws7skBbW+fUBMeg+jrT30+GP00jTHvCcL4fuVrShuML0uveEV/4vVUdvqEVnDgXIGfLm0GXW5EID2mCcRXhg==
dependencies:
server-only "^0.0.1"
"@vercel/speed-insights@^1.0.2": "@vercel/speed-insights@^1.0.2":
version "1.0.2" version "1.0.2"
@ -7568,6 +7570,11 @@ serialize-javascript@^6.0.1:
dependencies: dependencies:
randombytes "^2.1.0" randombytes "^2.1.0"
server-only@^0.0.1:
version "0.0.1"
resolved "https://mirrors.cloud.tencent.com/npm/server-only/-/server-only-0.0.1.tgz#0f366bb6afb618c37c9255a314535dc412cd1c9e"
integrity sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==
shebang-command@^2.0.0: shebang-command@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"