Merged in fix/tracking-requests (pull request #1208)

Added siteversion to all events and fixed payment status

* Added siteversion to all events and fixed payment status

* Fixed bug


Approved-by: Erik Tiekstra
This commit is contained in:
Linus Flood
2025-01-24 07:49:00 +00:00
parent 127bb6a0a7
commit cea4e3f3fe
6 changed files with 31 additions and 19 deletions

View File

@@ -38,6 +38,7 @@ export default function PaymentCallback({
trackPaymentEvent({
event: "paymentCancel",
hotelId: detailsStorage.booking.hotelId,
status: "cancelled",
})
}
if (status === "error") {
@@ -45,6 +46,7 @@ export default function PaymentCallback({
event: "paymentFail",
hotelId: detailsStorage.booking.hotelId,
errorMessage,
status: "failed",
})
}

View File

@@ -176,6 +176,7 @@ export default function PaymentClient({
isSavedCreditCard,
smsEnable,
errorMessage,
status: "failed",
})
},
[intl, methods, savedCreditCards, hotelId]
@@ -230,6 +231,7 @@ export default function PaymentClient({
method: paymentMethod,
isSavedCreditCard: !!savedCreditCard,
smsEnable: data.smsConfirmation,
status: "attempt",
})
initiateBooking.mutate({

View File

@@ -13,7 +13,7 @@ import useRouterTransitionStore from "@/stores/router-transition"
import useTrackingStore from "@/stores/tracking"
import { useSessionId } from "@/hooks/useSessionId"
import { createSDKPageObject, pushToDataLayer } from "@/utils/tracking"
import { createSDKPageObject, trackPageView } from "@/utils/tracking"
import type { TrackingSDKProps } from "@/types/components/tracking"
@@ -59,7 +59,7 @@ export default function RouterTransition({
pageLoadTime: entry.duration / 1000,
}
const pageObject = createSDKPageObject(trackingData)
pushToDataLayer({
trackPageView({
event: "pageView",
pageInfo: pageObject,
userInfo: userData,
@@ -115,7 +115,7 @@ export default function RouterTransition({
}
const pageObject = createSDKPageObject(trackingData)
if (previousPathname.current !== pathName) {
pushToDataLayer({
trackPageView({
event: "pageView",
pageInfo: pageObject,
userInfo: userData,