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:
Bianca Widstam
2025-10-22 14:34:59 +00:00
parent acdc3dcec1
commit 76c353058b
17 changed files with 40 additions and 35 deletions

View File

@@ -3,7 +3,6 @@
import { TrackingSDK } from "@scandic-hotels/tracking/TrackingSDK"
import { useBookingFlowConfig } from "../../../bookingFlowConfig/bookingFlowConfigContext"
import { useSearchHistory } from "../../../hooks/useSearchHistory"
import { useEnterDetailsStore } from "../../../stores/enter-details"
import { getTracking } from "./tracking"
@@ -33,8 +32,6 @@ export default function EnterDetailsTrackingWrapper({
breakfastPackages: state.breakfastPackages,
}))
const config = useBookingFlowConfig()
const searchHistory = useSearchHistory()
const searchTerm = searchHistory.searchHistory[0]?.name
const { hotelsTrackingData, pageTrackingData, ancillaries } = getTracking(
booking,
@@ -44,8 +41,7 @@ export default function EnterDetailsTrackingWrapper({
lang,
storedRooms,
breakfastPackages,
config,
searchTerm
config
)
return (

View File

@@ -36,8 +36,7 @@ export function getTracking(
lang: Lang,
storedRooms: RoomState[],
breakfastPackages: BreakfastPackages,
config: Pick<BookingFlowConfig, "bookingCodeEnabled">,
searchTerm?: string
config: Pick<BookingFlowConfig, "bookingCodeEnabled">
) {
const arrivalDate = new Date(booking.fromDate)
const departureDate = new Date(booking.toDate)
@@ -205,7 +204,7 @@ export function getTracking(
// @ts-expect-error - redemption object doesn't exist error
rooms.find((room) => "redemption" in room.roomRate)?.roomRate.redemption
.localPrice.pointsPerStay ?? "n/a",
searchTerm,
searchTerm: hotel.name,
searchType: "hotel",
specialRoomType: rooms
.map((room) => getSpecialRoomType(room.packages))