better-auth/apps/web/modules/analytics/provider/google/index.tsx
 Илья Шалонин 8538ab969a first
2025-10-29 13:43:43 +05:00

17 lines
351 B
TypeScript

"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,
};
}