Merged in fix/SW-2418-tracking-booking-cancellations (pull request #2500)

fix(SW-2418): add duration and price to booking cancellations tracking

* fix(SW-2418): add duration and price to booking cancellations tracking

* fix(SW-2418): move sessionId and siteVersion inside the pageInfo object


Approved-by: Matilda Landström
This commit is contained in:
Bianca Widstam
2025-07-07 06:02:12 +00:00
parent 8f8240625a
commit ef40d16a2f
3 changed files with 27 additions and 3 deletions
+4 -1
View File
@@ -16,7 +16,10 @@ export function trackEvent(data: any) {
logger.error("Error getting sessionId from sessionStorage", e)
}
data = { ...data, siteVersion: "new-web", sessionId }
data = {
...data,
pageInfo: { ...data?.pageInfo, siteVersion: "new-web", sessionId },
}
window.adobeDataLayer.push(data)
window.dataLayer.push(data)
+8 -1
View File
@@ -10,11 +10,18 @@ import type { SelectedAncillary } from "@/types/components/myPages/myStay/ancill
import type { Room } from "@/types/stores/my-stay"
import type { BreakfastData } from "@/stores/my-stay/add-ancillary-flow"
export function trackCancelStay(hotelId: string, bnr: string) {
export function trackCancelStay(
hotelId: string,
duration: number,
bnr: string,
roomPrice?: number
) {
trackEvent({
event: "BookingCancellations",
hotelInfo: {
hotelId: hotelId,
duration,
roomPrice,
bnr: bnr,
},
})