Skip to content

Commit c440af8

Browse files
committed
feat : 5. 중간지점 산출
1 parent 32a9f89 commit c440af8

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

app/meeting/[id]/page.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import MeetingInfoSection from '@/components/meeting/MeetingInfoSection';
1515
import { useToast } from '@/hooks/useToast';
1616
import Toast from '@/components/ui/toast';
1717
import { getMeetingUserId, removeMeetingUserId } from '@/lib/storage';
18-
18+
import { sendGAEvent } from '@next/third-parties/google';
1919
interface StationInfo {
2020
line: string;
2121
name: string;
@@ -127,6 +127,21 @@ export default function Page() {
127127
show();
128128
return;
129129
}
130+
131+
if (typeof window !== 'undefined') {
132+
const calculationType = id ? 'recalculated' : 'first';
133+
const isHost = localStorage.getItem(`browser_id`) !== null;
134+
const role_type = isHost ? 'host' : 'participant';
135+
const browserId = localStorage.getItem('browser_id');
136+
137+
sendGAEvent('event', 'midpoint_calculated', {
138+
meeting_url_id: id,
139+
browser_id: browserId,
140+
role: role_type,
141+
calculation_type: calculationType,
142+
});
143+
}
144+
130145
router.push(`/result/${id}`);
131146
};
132147

0 commit comments

Comments
 (0)