Integrate Rybbit analytics and enhance user tracking features
All checks were successful
Deploy / deploy (push) Successful in 16m7s
All checks were successful
Deploy / deploy (push) Successful in 16m7s
- 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.
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
useTercihProfili,
|
||||
} from "@/components/manuel-liste/profil-kapisi-store";
|
||||
import { PUAN_TURU_ETIKET } from "@/lib/sihirbaz";
|
||||
import { olay } from "@/lib/analitik";
|
||||
import {
|
||||
ArrowRight,
|
||||
BookOpenText,
|
||||
@@ -96,6 +97,11 @@ export function KatalogArama({ rehberler }: { rehberler: RehberOzet[] }) {
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
const kaydirmaRef = useRef<HTMLDivElement>(null);
|
||||
const [kenarBlur, setKenarBlur] = useState({ ust: false, alt: false });
|
||||
// Kapanışta gönderilecek son arama özeti (bkz. aşağıdaki fetch efekti)
|
||||
const sonAramaRef = useRef<{
|
||||
sorgu_uzunlugu: number;
|
||||
sonuc_sayisi: number;
|
||||
} | null>(null);
|
||||
const temizSorgu = sorgu.trim();
|
||||
const aramaAktif = temizSorgu.length >= 2;
|
||||
|
||||
@@ -163,7 +169,14 @@ export function KatalogArama({ rehberler }: { rehberler: RehberOzet[] }) {
|
||||
{ signal: controller.signal },
|
||||
);
|
||||
if (!response.ok) throw new Error("Arama başarısız");
|
||||
setSonuclar((await response.json()) as AramaSonuclari);
|
||||
const veri = (await response.json()) as AramaSonuclari;
|
||||
setSonuclar(veri);
|
||||
// Olay burada değil kapanışta gönderilir; fetch her tuş vuruşunda
|
||||
// (160ms debounce) tetikleniyor, aramayı oturum başına bir kez sayarız.
|
||||
sonAramaRef.current = {
|
||||
sorgu_uzunlugu: temizSorgu.length,
|
||||
sonuc_sayisi: veri.bolumler.length + veri.universiteler.length,
|
||||
};
|
||||
} catch (hata) {
|
||||
if (!(hata instanceof DOMException && hata.name === "AbortError")) {
|
||||
setSonuclar(BOS_SONUCLAR);
|
||||
@@ -207,6 +220,15 @@ export function KatalogArama({ rehberler }: { rehberler: RehberOzet[] }) {
|
||||
}
|
||||
}
|
||||
|
||||
// Arama oturumu kapandığında tek bir olay — hiç arama yapılmadıysa sessiz
|
||||
useEffect(() => {
|
||||
if (acik) return;
|
||||
const son = sonAramaRef.current;
|
||||
if (!son) return;
|
||||
sonAramaRef.current = null;
|
||||
olay("katalog_arama", son);
|
||||
}, [acik]);
|
||||
|
||||
function kapat() {
|
||||
setAcik(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user