UNPKG

umami-analytics-react

Version:

React hooks (useUmami, useUmamiView) and UmamiProvider for seamless Umami analytics integration, supporting page views, custom event tracking, and session identification.

10 lines (9 loc) 272 B
import { useEffect } from "react"; import { useUmami } from "./use-umami"; export function useUmamiView(viewDependencies = [], payload) { const { view } = useUmami(); useEffect(() => { view(payload); }, [view, ...viewDependencies]); return null; }