From 2cc5574f52496ee11b9c5cdc47e5d227107685ef Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Mon, 19 May 2025 08:05:43 +0000 Subject: [PATCH] Merged in feat/SW-2340-aa-tracking-my-stay-pageview- (pull request #2133) feat: SW-2340 Implemented tracking on my-stay, webview my-stay and receipt page * feat: SW-2340 Implemented tracking on my-stay, webview my-stay and receipt page * feat: SW-2340 Updated webview tracking * feat: SW-2340 Updated receipt tracking Approved-by: Linus Flood --- .../hotelreservation/my-stay/page.tsx | 3 +++ .../hotelreservation/my-stay/tracking.tsx | 23 +++++++++++++++++++ .../webview/hotelreservation/my-stay/page.tsx | 3 +++ .../hotelreservation/my-stay/tracking.tsx | 23 +++++++++++++++++++ .../HotelReservation/MyStay/Receipt/index.tsx | 2 ++ .../MyStay/Receipt/tracking.tsx | 23 +++++++++++++++++++ 6 files changed, 77 insertions(+) create mode 100644 apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/tracking.tsx create mode 100644 apps/scandic-web/app/[lang]/webview/hotelreservation/my-stay/tracking.tsx create mode 100644 apps/scandic-web/components/HotelReservation/MyStay/Receipt/tracking.tsx diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/page.tsx index bd2dee513..7482de5a0 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/page.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/page.tsx @@ -39,6 +39,8 @@ import { parseRefId } from "@/utils/refId" import { isValidSession } from "@/utils/session" import { getCurrentWebUrl } from "@/utils/url" +import Tracking from "./tracking" + import styles from "./page.module.css" import { BreakfastPackageEnum } from "@/types/enums/breakfast" @@ -256,6 +258,7 @@ export default async function MyStay({ + ) } diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/tracking.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/tracking.tsx new file mode 100644 index 000000000..4b18e6af7 --- /dev/null +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/my-stay/tracking.tsx @@ -0,0 +1,23 @@ +import TrackingSDK from "@/components/TrackingSDK" +import { getLang } from "@/i18n/serverContext" + +import { + TrackingChannelEnum, + type TrackingSDKPageData, +} from "@/types/components/tracking" + +export default function Tracking() { + const lang = getLang() + + const pageTrackingData: TrackingSDKPageData = { + channel: TrackingChannelEnum.hotels, + domainLanguage: lang, + pageId: "my-stay", + pageName: `hotelreservation|my-stay`, + pageType: "bookingmystaypage", + siteSections: `hotelreservation|my-stay`, + siteVersion: "new-web", + } + + return +} diff --git a/apps/scandic-web/app/[lang]/webview/hotelreservation/my-stay/page.tsx b/apps/scandic-web/app/[lang]/webview/hotelreservation/my-stay/page.tsx index 6ba593415..751fff1a8 100644 --- a/apps/scandic-web/app/[lang]/webview/hotelreservation/my-stay/page.tsx +++ b/apps/scandic-web/app/[lang]/webview/hotelreservation/my-stay/page.tsx @@ -39,6 +39,8 @@ import { parseRefId } from "@/utils/refId" import { isValidSession } from "@/utils/session" import { getCurrentWebUrl } from "@/utils/url" +import Tracking from "./tracking" + import styles from "./page.module.css" import { BreakfastPackageEnum } from "@/types/enums/breakfast" @@ -259,6 +261,7 @@ export default async function MyStay({ + ) } diff --git a/apps/scandic-web/app/[lang]/webview/hotelreservation/my-stay/tracking.tsx b/apps/scandic-web/app/[lang]/webview/hotelreservation/my-stay/tracking.tsx new file mode 100644 index 000000000..4684e901c --- /dev/null +++ b/apps/scandic-web/app/[lang]/webview/hotelreservation/my-stay/tracking.tsx @@ -0,0 +1,23 @@ +import TrackingSDK from "@/components/TrackingSDK" +import { getLang } from "@/i18n/serverContext" + +import { + TrackingChannelEnum, + type TrackingSDKPageData, +} from "@/types/components/tracking" + +export default function Tracking() { + const lang = getLang() + + const pageTrackingData: TrackingSDKPageData = { + channel: TrackingChannelEnum.hotels, + domainLanguage: lang, + pageId: "my-stay", + pageName: `webview|hotelreservation|my-stay`, + pageType: "bookingmystaypage", + siteSections: `webview|hotelreservation|my-stay`, + siteVersion: "new-web", + } + + return +} diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Receipt/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Receipt/index.tsx index 4a7c16be4..749e58642 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Receipt/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Receipt/index.tsx @@ -27,6 +27,7 @@ import accessBooking, { import Footer from "./Footer" import Specification from "./Specification" import Total from "./Total" +import Tracking from "./tracking" import styles from "./receipt.module.css" @@ -178,6 +179,7 @@ export async function Receipt({ refId }: { refId: string }) {