Analytics

Available options for analytics.

I'll show two options here but feel free to use whatever you'd like!

Umami Analytics (Open Source & Free)

  1. Follow the installation here and copy your website-id
  2. Update the .env file
NEXT_PUBLIC_ANALYTICS_UMAMI_HOST="https://cloud.umami.is/script.js"
NEXT_PUBLIC_ANALYTICS_UMAMI_WEBSITE_ID="..."

Here is an exemple after setup: Exemple Umami

Vercel Analytics

Another alternative is Vercel Analytics.

  1. Install the Package
bun install @vercel/analytics
  1. Navigate to app/layout.tsx and add the following

  2. Implementation

// app/layout.tsx
import { Analytics } from "@vercel/analytics/react";
 
export default function RootLayout({
    children,
}: {
    children: React.ReactNode;
}) {
    return (
        <html lang="en">
            <body>
                {children}
                <Analytics />
            </body>
        </html>
    );
}

On this page