gtag 추가
This commit is contained in:
@@ -199,6 +199,7 @@ import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { useToast } from 'primevue/usetoast';
|
||||
import scoreService from '@/services/scoreService';
|
||||
import { useGtag } from 'vue-gtag-next';
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
@@ -411,7 +412,13 @@ const calculateTotal = (participant) => {
|
||||
};
|
||||
|
||||
// 모든 점수 저장
|
||||
// 점수 저장 버튼 클릭 시 GA 이벤트 추적
|
||||
const saveAllScores = async () => {
|
||||
const gtag = useGtag();
|
||||
gtag.event('save_scores', {
|
||||
event_category: '점수관리',
|
||||
event_label: '점수 저장'
|
||||
});
|
||||
try {
|
||||
loading.value = true;
|
||||
await scoreService.saveScores(meetingId.value, participants.value);
|
||||
@@ -425,7 +432,13 @@ const saveAllScores = async () => {
|
||||
};
|
||||
|
||||
// 점수 내보내기 다이얼로그 열기
|
||||
// 점수 내보내기 버튼 클릭 시 GA 이벤트 추적
|
||||
const exportScores = () => {
|
||||
const gtag = useGtag();
|
||||
gtag.event('export_scores', {
|
||||
event_category: '점수관리',
|
||||
event_label: '점수 내보내기'
|
||||
});
|
||||
exportContent.value = [exportContentOptions.value[0]];
|
||||
exportDialog.value = true;
|
||||
};
|
||||
@@ -446,12 +459,25 @@ const downloadExport = async () => {
|
||||
};
|
||||
|
||||
// 뒤로 가기
|
||||
// 뒤로가기 버튼 클릭 시 GA 이벤트 추적
|
||||
const goBack = () => {
|
||||
const gtag = useGtag();
|
||||
gtag.event('go_back', {
|
||||
event_category: '점수관리',
|
||||
event_label: '뒤로가기'
|
||||
});
|
||||
router.push('/clubs/meetings');
|
||||
};
|
||||
|
||||
// 컴포넌트 마운트 시 데이터 로드
|
||||
// 페이지 진입 시 Google Analytics 페이지뷰 추적
|
||||
onMounted(async () => {
|
||||
const gtag = useGtag();
|
||||
gtag.pageview({
|
||||
page_title: '점수관리',
|
||||
page_path: window.location.pathname,
|
||||
page_location: window.location.href
|
||||
});
|
||||
if (!clubId.value) {
|
||||
toast.add({ severity: 'error', summary: '오류', detail: '클럽 ID가 설정되지 않았습니다.', life: 3000 });
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user