feat(popup): add email capture popup with Mautic integration
Build and Deploy / build (push) Has been cancelled
Build and Deploy / build (push) Has been cancelled
- Email capture popup with scroll (10%) and exit intent triggers - First name field and full tracking (UTM, device, time on page) - Mautic API integration for contact creation - GeoIP detection for country/region - 4 locale support (sr, en, de, fr) - Mautic tracking script in layout
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export function useExitIntent(): boolean {
|
||||
const [showExitIntent, setShowExitIntent] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const handleMouseLeave = (e: MouseEvent) => {
|
||||
if (e.clientY <= 0) {
|
||||
setShowExitIntent(true);
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener("mouseleave", handleMouseLeave);
|
||||
|
||||
return () => document.removeEventListener("mouseleave", handleMouseLeave);
|
||||
}, []);
|
||||
|
||||
return showExitIntent;
|
||||
}
|
||||
Reference in New Issue
Block a user