Files
kolaytercih/src/components/rybbit-identify.tsx
bilalgursen 0b92f999bc
All checks were successful
Deploy / deploy (push) Successful in 16m7s
Integrate Rybbit analytics and enhance user tracking features
- Added Rybbit analytics configuration in .mcp.json for improved data collection.
- Updated layout.tsx to conditionally load the Rybbit analytics script in production.
- Enhanced user interaction tracking in various components, including GirisForm, RevizyonKutusu, and SatinAlForm, by logging specific events.
- Updated privacy policy page to reflect new data handling practices and added a section on service providers and data transfer.
- Improved user navigation and experience by integrating Rybbit's live visitor widget in the site footer.
2026-08-02 19:29:42 +03:00

36 lines
1019 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client";
// Rybbit'e giriş yapan kullanıcıyı bildirir.
//
// Neden burada: oturum zaten UserNav'da (sunucu bileşeni, Suspense içinde)
// çözülüyor. Layout'a authClient.useSession() kullanan global bir bileşen
// koymak landing'i statik olmaktan çıkarır ve ziyaret başına gereksiz bir
// auth turu attırırdı — bkz. hero-form.tsx'teki aynı gerekçe.
import { useEffect } from "react";
import { kullaniciTanit, kullaniciTemizle } from "@/lib/analitik";
export function RybbitIdentify({
kullaniciId,
eposta,
isim,
}: {
/** null = oturum yok; o cihazdaki kimlik temizlenir (çıkış sonrası) */
kullaniciId: string | null;
eposta?: string | null;
isim?: string | null;
}) {
useEffect(() => {
if (!kullaniciId) {
kullaniciTemizle();
return;
}
const traits: Record<string, string> = {};
if (eposta) traits.email = eposta;
if (isim) traits.name = isim;
kullaniciTanit(kullaniciId, traits);
}, [kullaniciId, eposta, isim]);
return null;
}