diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Tracking/tracking.ts b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Tracking/tracking.ts index 3edc1c443..3ec0cb4a6 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Tracking/tracking.ts +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Tracking/tracking.ts @@ -1,3 +1,4 @@ +import { createHash } from "crypto" import { differenceInCalendarDays, format, isWeekend } from "date-fns" import { CurrencyEnum } from "@scandic-hotels/common/constants/currency" @@ -169,6 +170,8 @@ export function getTracking( : "no" : "na", guaranteedProduct: isGuaranteedFlexBooking ? "room" : "na", + emailId: getSHAHash(booking.guest.email), + mobileNumber: getSHAHash(booking.guest.phoneNumber), } const paymentInfo: TrackingSDKPaymentInfo = { @@ -208,3 +211,7 @@ function constructRateCodeName(room: Room) { .filter(Boolean) .join(" - ") } + +function getSHAHash(key: string) { + return createHash("sha256").update(key).digest("hex") +} diff --git a/apps/scandic-web/types/components/tracking.ts b/apps/scandic-web/types/components/tracking.ts index 2625acd7a..5cb32c182 100644 --- a/apps/scandic-web/types/components/tracking.ts +++ b/apps/scandic-web/types/components/tracking.ts @@ -95,6 +95,8 @@ export type TrackingSDKHotelInfo = { totalPrice?: number | string lateArrivalGuarantee?: string guaranteedProduct?: string + emailId?: string // Encrypted hash value on booking confirmation page + mobileNumber?: string // Encrypted hash value on booking confirmation page } export type Ancillary = {