Some hotelInfo tracking on select-hotel page

This commit is contained in:
Linus Flood
2024-10-18 10:25:45 +02:00
parent 42640abb2b
commit bbf52c8dce
4 changed files with 30 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import { Lang } from "@/constants/languages"
import { selectHotelMap } from "@/constants/routes/hotelReservation"
import {
@@ -9,11 +10,17 @@ import HotelFilter from "@/components/HotelReservation/SelectHotel/HotelFilter"
import { ChevronRightIcon } from "@/components/Icons"
import StaticMap from "@/components/Maps/StaticMap"
import Link from "@/components/TempDesignSystem/Link"
import TrackingSDK from "@/components/TrackingSDK"
import { getIntl } from "@/i18n"
import { setLang } from "@/i18n/serverContext"
import styles from "./page.module.css"
import {
TrackingChannelEnum,
TrackingSDKHotelInfo,
TrackingSDKPageData,
} from "@/types/components/tracking"
import { LangParams, PageArgs } from "@/types/params"
export default async function SelectHotelPage({
@@ -33,6 +40,22 @@ export default async function SelectHotelPage({
const filterList = getFiltersFromHotels(hotels)
const pageTrackingData: TrackingSDKPageData = {
pageId: "select-hotel",
domainLanguage: params.lang as Lang,
channel: TrackingChannelEnum["hotelreservation"],
pageName: "hotelreservation|select-hotel",
siteSections: "hotelreservation|select-hotel",
createdDate: "",
publishedDate: "",
pageType: "selecthotelpage",
}
const hotelsTrackingData: TrackingSDKHotelInfo = {
availableResults: hotels.length,
searchTerm: tempSearchTerm,
}
return (
<main className={styles.main}>
<section className={styles.section}>
@@ -58,6 +81,7 @@ export default async function SelectHotelPage({
<HotelFilter filters={filterList} />
</section>
<HotelCardListing hotelData={hotels} />
<TrackingSDK pageData={pageTrackingData} hotelInfo={hotelsTrackingData} />
</main>
)
}