From 346134ac6330d13917835ec68c82032296372745 Mon Sep 17 00:00:00 2001 From: Noelia Donato Date: Sat, 23 Mar 2024 13:52:07 +0100 Subject: [PATCH] feat: add umami analytics --- app/layout.tsx | 19 ++++- components/button/button-up.tsx | 2 + components/card/card.tsx | 1 + components/contributors/contributors.tsx | 5 +- components/figure/figure.tsx | 4 + components/navbar/navbar.tsx | 10 +-- .../theme-controller/theme-controller.tsx | 75 ++++++++++--------- components/web-link/web-link.test.tsx | 19 +++-- components/web-link/web-link.tsx | 5 +- docs/index.mdx | 10 +-- lib/metrics/event-name-types.ts | 8 ++ package-lock.json | 14 ---- package.json | 1 - 13 files changed, 99 insertions(+), 74 deletions(-) create mode 100644 lib/metrics/event-name-types.ts diff --git a/app/layout.tsx b/app/layout.tsx index 3e23a56..c8d8f3b 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,5 +1,5 @@ -import { Analytics } from '@vercel/analytics/react' import type { Metadata } from 'next' +import Script from 'next/script' import { ButtonUp } from '@/components/button/button-up' import Navbar from '@/components/navbar/navbar' @@ -19,10 +19,24 @@ export default function RootLayout({ }: { children: React.ReactNode }) { + const UMAMI_ANALYTICS = process.env.NEXT_PUBLIC_ANALYTICS_ID + const environment = process.env.NODE_ENV + return ( -