Merged in feat/SW-1996-tracking-gla-my-stay (pull request #1625)
Feat/SW-1996 tracking gla my stay * feat(SW-1996): tracking gla my stay * feat(SW-1996): update gla tracking * feat(SW-1996): update gla tracking * feat(SW-1996): fix comment * feat(SW-1996): fix camelCase Approved-by: Niclas Edenvin Approved-by: Erik Tiekstra
This commit is contained in:
@@ -26,6 +26,7 @@ import { toast } from "@/components/TempDesignSystem/Toasts"
|
|||||||
import { useGuaranteeBooking } from "@/hooks/booking/useGuaranteeBooking"
|
import { useGuaranteeBooking } from "@/hooks/booking/useGuaranteeBooking"
|
||||||
import useLang from "@/hooks/useLang"
|
import useLang from "@/hooks/useLang"
|
||||||
import { formatPrice } from "@/utils/numberFormatting"
|
import { formatPrice } from "@/utils/numberFormatting"
|
||||||
|
import { trackGlaSaveCardAttempt } from "@/utils/tracking/myStay"
|
||||||
|
|
||||||
import MySavedCards from "../../EnterDetails/Payment/MySavedCards"
|
import MySavedCards from "../../EnterDetails/Payment/MySavedCards"
|
||||||
import PaymentOption from "../../EnterDetails/Payment/PaymentOption"
|
import PaymentOption from "../../EnterDetails/Payment/PaymentOption"
|
||||||
@@ -82,6 +83,12 @@ export default function GuaranteeLateArrival({
|
|||||||
const savedCreditCard = savedCreditCards?.find(
|
const savedCreditCard = savedCreditCards?.find(
|
||||||
(card) => card.id === data.paymentMethod
|
(card) => card.id === data.paymentMethod
|
||||||
)
|
)
|
||||||
|
trackGlaSaveCardAttempt(
|
||||||
|
bookedRoom.hotelId,
|
||||||
|
data.paymentMethod,
|
||||||
|
savedCreditCard,
|
||||||
|
"yes"
|
||||||
|
)
|
||||||
if (bookedRoom.confirmationNumber) {
|
if (bookedRoom.confirmationNumber) {
|
||||||
const card = savedCreditCard
|
const card = savedCreditCard
|
||||||
? {
|
? {
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
|
import { PaymentMethodEnum } from "@/constants/booking"
|
||||||
|
|
||||||
import { trackEvent } from "./base"
|
import { trackEvent } from "./base"
|
||||||
|
|
||||||
|
import type { CreditCard } from "@/types/user"
|
||||||
|
|
||||||
export function trackCancelStay(hotelId: string, bnr: string) {
|
export function trackCancelStay(hotelId: string, bnr: string) {
|
||||||
trackEvent({
|
trackEvent({
|
||||||
event: "BookingCancellations",
|
event: "BookingCancellations",
|
||||||
@@ -18,3 +22,27 @@ export function trackMyStayPageLink(ctaName: string) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type LateArrivalGuarantee = "mandatory" | "yes" | "no" | "na"
|
||||||
|
|
||||||
|
export function trackGlaSaveCardAttempt(
|
||||||
|
hotelId: string,
|
||||||
|
paymentMethod: string | null,
|
||||||
|
savedCreditCard: CreditCard | undefined,
|
||||||
|
lateArrivalGuarantee: LateArrivalGuarantee
|
||||||
|
) {
|
||||||
|
trackEvent({
|
||||||
|
event: "glaCardSaveAttempt",
|
||||||
|
hotelInfo: {
|
||||||
|
hotelId,
|
||||||
|
lateArrivalGuarantee,
|
||||||
|
guaranteedProduct: "room",
|
||||||
|
},
|
||||||
|
paymentInfo: {
|
||||||
|
isCreditCard: paymentMethod === PaymentMethodEnum.card,
|
||||||
|
isSavedCreditCard: !!savedCreditCard,
|
||||||
|
status: "glacardsaveattempt",
|
||||||
|
type: savedCreditCard?.cardType,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user