Tracking payment start event

This commit is contained in:
Linus Flood
2025-01-08 10:48:43 +01:00
parent 519795acac
commit 20714d0c3b
3 changed files with 40 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ import { useAvailablePaymentOptions } from "@/hooks/booking/useAvailablePaymentO
import { useHandleBookingStatus } from "@/hooks/booking/useHandleBookingStatus"
import { usePaymentFailedToast } from "@/hooks/booking/usePaymentFailedToast"
import useLang from "@/hooks/useLang"
import { trackPaymentEvent } from "@/utils/tracking"
import { bedTypeMap } from "../../SelectRate/RoomSelection/utils"
import PriceChangeDialog from "../PriceChangeDialog"
@@ -206,6 +207,14 @@ export default function PaymentClient({
const paymentRedirectUrl = `${env.NEXT_PUBLIC_NODE_ENV === "development" ? `http://localhost:${env.NEXT_PUBLIC_PORT}` : ""}/${lang}/hotelreservation/payment-callback`
trackPaymentEvent({
event: "paymentAttemptStart",
hotelId: hotel,
method: paymentMethod,
isSavedCreditCard: savedCreditCard ? true : false,
smsEnable: data.smsConfirmation,
})
initiateBooking.mutate({
language: lang,
hotelId: hotel,