From 74de48059ca5c25950855a1ed755c141d566b864 Mon Sep 17 00:00:00 2001 From: Gautier Darchen Date: Mon, 24 Jun 2024 17:56:37 +0200 Subject: [PATCH] chore(analytics): add Next analytics --- package.json | 1 + pnpm-lock.yaml | 26 ++++++++++++++++++++++++++ src/app/layout.tsx | 6 +++++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 73b55b2..3321944 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ }, "dependencies": { "@headlessui/react": "^2.0.4", + "@vercel/analytics": "^1.3.1", "aos": "^2.3.4", "clsx": "^2.1.1", "framer-motion": "^4.1.17", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 05d5b41..509dfb5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: '@headlessui/react': specifier: ^2.0.4 version: 2.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@vercel/analytics': + specifier: ^1.3.1 + version: 1.3.1(next@14.2.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) aos: specifier: ^2.3.4 version: 2.3.4 @@ -507,6 +510,17 @@ packages: '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + '@vercel/analytics@1.3.1': + resolution: {integrity: sha512-xhSlYgAuJ6Q4WQGkzYTLmXwhYl39sWjoMA3nHxfkvG+WdBT25c563a7QhwwKivEOZtPJXifYHR1m2ihoisbWyA==} + peerDependencies: + next: '>= 13' + react: ^18 || ^19 + peerDependenciesMeta: + next: + optional: true + react: + optional: true + '@zeit/schemas@2.36.0': resolution: {integrity: sha512-7kjMwcChYEzMKjeex9ZFXkt1AyNov9R5HZtjBKVsmVpw7pa7ZtlCGvCBC2vnnXctaYN+aRI61HjIqeetZW5ROg==} @@ -2185,6 +2199,9 @@ packages: engines: {node: '>= 14'} hasBin: true + server-only@0.0.1: + resolution: {integrity: sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==} + set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} @@ -2960,6 +2977,13 @@ snapshots: '@ungap/structured-clone@1.2.0': {} + '@vercel/analytics@1.3.1(next@14.2.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)': + dependencies: + server-only: 0.0.1 + optionalDependencies: + next: 14.2.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react: 18.3.1 + '@zeit/schemas@2.36.0': {} JSONStream@1.3.5: @@ -4806,6 +4830,8 @@ snapshots: transitivePeerDependencies: - supports-color + server-only@0.0.1: {} + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 23c4b8e..1d13f38 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -2,6 +2,7 @@ import { FC, PropsWithChildren } from 'react' import { Metadata } from 'next' import { WEBSITE_URL } from '@/constants/globals' +import { Analytics } from "@vercel/analytics/react" import './globals.css' import 'aos/dist/aos.css' @@ -52,7 +53,10 @@ const RootLayout: FC = ({ children }) => { href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css" /> - {children} + + {children} + + ) }