gtag 추가

This commit is contained in:
2025-07-03 08:36:26 +09:00
parent 01aa5dfe66
commit 73b6439702
23 changed files with 414 additions and 17 deletions
+15
View File
@@ -146,9 +146,11 @@ import { useRouter } from 'vue-router';
import apiClient from '@/services/api';
import dayjs from 'dayjs';
import { useToast } from 'primevue/usetoast';
import { useGtag } from 'vue-gtag-next';
const router = useRouter();
const toast = useToast();
const gtag = useGtag();
// 데이터 상태 변수들
const loading = ref(false);
@@ -260,6 +262,12 @@ const loadDashboardData = async () => {
// 페이지 이동 함수
const navigateTo = (path) => {
// Google Analytics 이벤트 추적
gtag.event('navigation', {
'event_category': '대시보드',
'event_label': path,
'value': 1
});
router.push(path);
};
@@ -267,6 +275,13 @@ const navigateTo = (path) => {
onMounted(async () => {
clubId.value = localStorage.getItem('clubId') || null;
await loadDashboardData();
// Google Analytics 페이지뷰 추적
gtag.pageview({
page_title: '클럽 대시보드',
page_path: window.location.pathname,
page_location: window.location.href
});
});
</script>