Merged in fix/SW-1997-gla-tracking (pull request #1852)

fix(SW-1997): add price and currency

* fix(SW-1997): add price and currency

* fix(SW-1997): wrap lateArrivalGuaranteee and guaranteedProduct in hotelInfo


Approved-by: Niclas Edenvin
This commit is contained in:
Bianca Widstam
2025-04-24 13:41:29 +00:00
parent 26d3d1b1d3
commit 77eff2b49c
2 changed files with 29 additions and 13 deletions

View File

@@ -48,19 +48,25 @@ export default function TrackGuarantee({
productUnits: pkg.quantity,
productPoints: selectedAncillary?.points,
productDeliveryTime: formData?.deliveryTime,
productPrice: selectedAncillary?.price,
productPrice: selectedAncillary?.price.total,
currency: selectedAncillary?.price.currency,
productName: selectedAncillary?.title,
productCategory: selectedAncillary?.categoryName,
})),
lateArrivalGuarantee: "yes",
guaranteedProduct: "room + ancillary",
hotelInfo: {
hotelId: selectedAncillary?.hotelId,
lateArrivalGuarantee: "yes",
guaranteedProduct: "room + ancillary",
},
})
}
const trackGuaranteePaymentEvent = (event: string, status: string) => {
const glaHotelInfo = readGlaFromSessionStorage()
trackEvent({
event,
hotelInfo: {
hotelId: glaHotelInfo?.hotelId,
lateArrivalGuarantee: "yes",
guaranteedProduct: "room",
},

View File

@@ -66,12 +66,16 @@ export function trackGlaAncillaryAttempt(
productUnits: pkg.quantity,
productPoints: selectedAncillary?.points,
productDeliveryTime: deliveryTime,
productPrice: selectedAncillary?.price,
productPrice: selectedAncillary?.price.total,
currency: selectedAncillary?.price.currency,
productName: selectedAncillary?.title,
productCategory: selectedAncillary?.categoryName,
})),
lateArrivalGuarantee: "yes",
guaranteedProduct: "room + ancillary",
hotelInfo: {
hotelId: selectedAncillary?.hotelId,
lateArrivalGuarantee: "yes",
guaranteedProduct: "room + ancillary",
},
})
}
@@ -93,6 +97,8 @@ export function trackAncillarySuccess(
hotelInfo: {
bnr: confirmationNumber,
roomTypeCode: roomTypeCode,
lateArrivalGuarantee: "yes",
guaranteedProduct: guaranteedProduct,
},
paymentInfo: {
status: "glacardsaveconfirmed",
@@ -103,12 +109,11 @@ export function trackAncillarySuccess(
productUnits: pkg.quantity,
productPoints: selectedAncillary?.points,
productDeliveryTime: deliveryTime,
productPrice: selectedAncillary?.price,
productPrice: selectedAncillary?.price.total,
currency: selectedAncillary?.price.currency,
productName: selectedAncillary?.title,
productCategory: selectedAncillary?.categoryName,
})),
lateArrivalGuarantee: "yes",
guaranteedProduct: guaranteedProduct,
})
}
@@ -128,12 +133,16 @@ export function trackAncillaryFailed(
productUnits: pkg.quantity,
productPoints: selectedAncillary?.points,
productDeliveryTime: deliveryTime,
productPrice: selectedAncillary?.price,
productPrice: selectedAncillary?.price.total,
currency: selectedAncillary?.price.currency,
productName: selectedAncillary?.title,
productCategory: selectedAncillary?.categoryName,
})),
lateArrivalGuarantee: "yes",
guaranteedProduct: "ancillary",
hotelInfo: {
hotelId: selectedAncillary?.hotelId,
lateArrivalGuarantee: "yes",
guaranteedProduct: "ancillary",
},
})
}
@@ -184,7 +193,8 @@ export function trackAddAncillary(
productId: ancillary?.id,
productName: ancillary?.title,
productUnits: quantityWithCard,
productPrice: ancillary?.price,
productPrice: ancillary?.price.total,
currency: ancillary?.price.currency,
productCategory: ancillary?.categoryName,
})
}