better-auth/apps/web/modules/analytics/provider/google/index.tsx

18 lines
351 B
TypeScript
Raw Normal View History

2025-10-29 13:43:43 +05:00
"use client";
import { GoogleAnalytics, sendGAEvent } from "@next/third-parties/google";
const googleTagId = process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID as string;
export function AnalyticsScript() {
return <GoogleAnalytics gaId={googleTagId} />;
}
export function useAnalytics() {
const trackEvent = sendGAEvent;
return {
trackEvent,
};
}