fix(BOOK-412): Using internalCategoryName to map ancillaries and show translated categoryName only

Approved-by: Linus Flood
This commit is contained in:
Erik Tiekstra
2025-10-10 09:10:51 +00:00
parent c2096ade2e
commit 50aaa095eb
6 changed files with 51 additions and 22 deletions

View File

@@ -56,7 +56,7 @@ export function buildAncillariesTracking(
productUnits: pkg.quantity,
productDeliveryTime: ancillaryDeliveryTime,
productName: selectedAncillary?.title,
productCategory: selectedAncillary?.categoryName,
productCategory: selectedAncillary?.translatedCategoryName,
...(payedWithCard && {
productPrice: (selectedAncillary?.price.total ?? 0) * pkg.quantity,
currency: selectedAncillary?.price.currency,
@@ -194,7 +194,7 @@ export function trackViewAncillary(
ancillary: SelectedAncillary,
booking: Room
) {
const { hotelId, id, title, categoryName } = ancillary
const { hotelId, id, title, translatedCategoryName } = ancillary
const isBreakfast = id === BreakfastPackageEnum.ANCILLARY_REGULAR_BREAKFAST
const hasPayingChildren = booking.childrenAges.some((age) => age >= 4)
@@ -203,7 +203,7 @@ export function trackViewAncillary(
hotelId,
productId: id,
productName: title,
productCategory: categoryName,
productCategory: translatedCategoryName,
},
]
@@ -212,7 +212,7 @@ export function trackViewAncillary(
hotelId,
productId: BreakfastPackageEnum.ANCILLARY_CHILD_PAYING_BREAKFAST,
productName: title,
productCategory: categoryName,
productCategory: translatedCategoryName,
})
}
@@ -283,7 +283,7 @@ export function trackAddAncillary(
productUnits: quantityWithCard,
productPrice: (ancillary?.price.total ?? 0) * (quantityWithCard ?? 0),
currency: ancillary?.price.currency,
productCategory: ancillary?.categoryName,
productCategory: ancillary?.translatedCategoryName,
})
}
@@ -294,7 +294,7 @@ export function trackAddAncillary(
productName: ancillary?.title,
productUnits: quantityWithPoints,
productPoints: (ancillary?.points ?? 0) * (quantityWithPoints ?? 0),
productCategory: ancillary?.categoryName,
productCategory: ancillary?.translatedCategoryName,
})
}
trackEvent({