Merged in fix/BOOK-459-tracking-search (pull request #2984)
fix(BOOK-459): update searchTerm to city or hotelname * fix(BOOK-459): update searchTerm to city or hotelname Approved-by: Erik Tiekstra
This commit is contained in:
@@ -7,7 +7,6 @@ import { TrackingSDK } from "@scandic-hotels/tracking/TrackingSDK"
|
||||
import { useBookingFlowConfig } from "../../../bookingFlowConfig/bookingFlowConfigContext"
|
||||
import { clearPaymentInfoSessionStorage } from "../../../components/EnterDetails/Payment/helpers"
|
||||
import useLang from "../../../hooks/useLang"
|
||||
import { useSearchHistory } from "../../../hooks/useSearchHistory"
|
||||
import { useBookingConfirmationStore } from "../../../stores/booking-confirmation"
|
||||
import { getTracking } from "./tracking"
|
||||
|
||||
@@ -37,9 +36,6 @@ export default function BookingConfirmationTracking({
|
||||
sessionStorage.setItem("loadedBookingConfirmationRefId", refId)
|
||||
}, [refId])
|
||||
|
||||
const searchHistory = useSearchHistory()
|
||||
const searchTerm = searchHistory.searchHistory[0]?.name
|
||||
|
||||
let trackingData = null
|
||||
|
||||
if (bookingRooms.every(Boolean)) {
|
||||
@@ -49,8 +45,7 @@ export default function BookingConfirmationTracking({
|
||||
bookingConfirmation.booking,
|
||||
bookingConfirmation.hotel,
|
||||
rooms,
|
||||
config,
|
||||
searchTerm
|
||||
config
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -64,8 +64,7 @@ export function getTracking(
|
||||
booking: BookingConfirmation["booking"],
|
||||
hotel: BookingConfirmation["hotel"],
|
||||
rooms: Room[],
|
||||
config: Pick<BookingFlowConfig, "bookingCodeEnabled">,
|
||||
searchTerm?: string
|
||||
config: Pick<BookingFlowConfig, "bookingCodeEnabled">
|
||||
) {
|
||||
const arrivalDate = new Date(booking.checkInDate)
|
||||
const departureDate = new Date(booking.checkOutDate)
|
||||
@@ -160,7 +159,7 @@ export function getTracking(
|
||||
points: booking.roomPoints > 0 ? booking.roomPoints : undefined,
|
||||
roomPrice: rooms.reduce((total, room) => total + room.roomPrice, 0),
|
||||
roomTypeCode: rooms.map((r) => r.roomTypeCode ?? "").join(","),
|
||||
searchTerm,
|
||||
searchTerm: hotel.name,
|
||||
searchType: "hotel",
|
||||
specialRoomType: rooms
|
||||
.map((room) => getSpecialRoomType(room.packages))
|
||||
|
||||
Reference in New Issue
Block a user