diff --git a/.env b/.env index dd0cd6ed..d5bc5065 100644 --- a/.env +++ b/.env @@ -1,4 +1,7 @@ WOOCOMMERCE_URL=https://klz-cables.com WOOCOMMERCE_CONSUMER_KEY=ck_38d97df86880e8fefbd54ab5cdf47a9c5a9e5b39 WOOCOMMERCE_CONSUMER_SECRET=cs_d675ee2ac2ec7c22de84ae5451c07e42b1717759 -WORDPRESS_APP_PASSWORD=DlJH 49dp fC3a Itc3 Sl7Z Wz0kโ€˜ \ No newline at end of file +WORDPRESS_APP_PASSWORD=DlJH 49dp fC3a Itc3 Sl7Z Wz0k' + +# Umami Analytics +NEXT_PUBLIC_UMAMI_WEBSITE_ID=59a7db94-0100-4c7e-98ef-99f45b17f9c3 \ No newline at end of file diff --git a/components/analytics/AnalyticsProvider.tsx b/components/analytics/AnalyticsProvider.tsx index 4a11dd84..44d8c99b 100644 --- a/components/analytics/AnalyticsProvider.tsx +++ b/components/analytics/AnalyticsProvider.tsx @@ -4,16 +4,40 @@ import { useEffect } from 'react'; import { usePathname, useSearchParams } from 'next/navigation'; import { getAppServices } from '@/lib/services/create-services'; -// Minimal client-side hook that sends Umami pageviews on route changes. +/** + * AnalyticsProvider Component + * + * Automatically tracks pageviews on client-side route changes. + * This component should be placed inside your layout to handle navigation events. + * + * @example + * ```tsx + * // In your layout.tsx + * + * + *
+ *
{children}
+ *