feat: GA4 전환 이벤트 추적 + 전 페이지 스크롤 리빌 애니메이션

- lib/gtag.ts: GA4 이벤트 유틸리티 (trackCTAClick, trackToolDemo, trackDownload, trackOutboundClick)
- ContactModal/ContactForm: 공용 trackEvent로 리팩토링 + generate_lead 이벤트
- 홈/tools/automation/prompt/website: CTA 클릭 이벤트 추적 추가
- 홈/freelance/ai-kit: IntersectionObserver 스크롤 리빌 애니메이션 신규 추가
- automation/prompt: GA4 trackCTAClick 적용

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-03 07:34:17 +09:00
parent c7bf0253e3
commit 5d2fd4be1f
10 changed files with 230 additions and 60 deletions

View File

@@ -1,6 +1,7 @@
'use client';
import { useState, useEffect, useRef } from 'react';
import { trackEvent } from '../../lib/gtag';
interface ContactModalProps {
isOpen: boolean;
@@ -63,17 +64,6 @@ export default function ContactModal({
setFormData((prev) => ({ ...prev, [e.target.name]: e.target.value }));
};
// GA4 이벤트 헬퍼
const trackEvent = (eventName: string, params?: Record<string, string>) => {
if (typeof window !== 'undefined') {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const w = window as any;
if (typeof w.gtag === 'function') {
w.gtag('event', eventName, params);
}
}
};
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setStatus('loading');