diff --git a/src/components/CTASection.tsx b/src/components/CTASection.tsx index b768f1d..cd1fe86 100644 --- a/src/components/CTASection.tsx +++ b/src/components/CTASection.tsx @@ -3,6 +3,13 @@ import { motion } from 'framer-motion'; import { Mail, MessageSquare } from 'lucide-react'; import { useT } from '../i18n'; +declare global { + interface Window { + // Injected by the Umami script (production builds only — see vite.config.ts). + umami?: { track: (event: string) => void }; + } +} + type Status = 'idle' | 'sending' | 'success' | 'error'; const CTASection = () => { @@ -72,6 +79,9 @@ const CTASection = () => { return; } setStatus('success'); + // Fire the Umami conversion goal only after a real 200 from the mailer. + // Guarded: the tracker is absent on dev/localhost, so this must not throw. + window.umami?.track('umow-rozmowe'); } catch { setErrorMsg(t.contact.errors.generic); setStatus('error');