@@ -15,6 +15,7 @@ import MeetingInfoSection from '@/components/meeting/MeetingInfoSection';
1515import { useToast } from '@/hooks/useToast' ;
1616import Toast from '@/components/ui/toast' ;
1717import { getMeetingUserId , removeMeetingUserId } from '@/lib/storage' ;
18+ import { pushDataLayer } from '@/lib/gtm' ;
1819
1920interface StationInfo {
2021 line : string ;
@@ -82,9 +83,7 @@ export default function Page() {
8283 localStorage . setItem ( 'browser_id' , browserId ) ;
8384 }
8485
85- const w = window as any ;
86- w . dataLayer = w . dataLayer || [ ] ;
87- w . dataLayer . push ( {
86+ pushDataLayer ( {
8887 event : 'share_link' ,
8988 meeting_url_id : id ,
9089 location : 'creation_complete' ,
@@ -148,9 +147,7 @@ export default function Page() {
148147 const isHost = localStorage . getItem ( `is_host_${ id } ` ) === 'true' ;
149148 const userRole = isHost ? 'host' : 'participant' ;
150149
151- const w = window as any ;
152- w . dataLayer = w . dataLayer || [ ] ;
153- w . dataLayer . push ( {
150+ pushDataLayer ( {
154151 event : 'departure_location_submitted' ,
155152 meeting_url_id : id ,
156153 user_cookie_id : browserId ,
@@ -182,9 +179,7 @@ export default function Page() {
182179 const userRole = isHost ? 'host' : 'participant' ;
183180 const browserId = localStorage . getItem ( 'browser_id' ) ;
184181
185- const w = window as any ;
186- w . dataLayer = w . dataLayer || [ ] ;
187- w . dataLayer . push ( {
182+ pushDataLayer ( {
188183 event : 'midpoint_calculated' ,
189184 meeting_url_id : id ,
190185 browser_id : browserId ,
0 commit comments