title |
---|
Analytics Google |
It's a wrapper component for @next/third-parties/google
. For it's usage, please refer to the documentation
https://nextjs.org/docs/app/building-your-application/optimizing/third-party-libraries#google-analytics
bunx shadcn add https://ui.tealight.uk/r/analytics-google
Set NEXT_PUBLIC_GOOGLE_ANALYTICS_ID
in .env
file, and import AnalyticsGoogle
component in your layout component.
import { AnalyticsGoogle } from "@/components/ui/analytics-google"
fucntion Layout({ children }) {
return <html>
<body>
{children}
<AnalyticsGoogle gaId={process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID!} />
</body>
</html>
}