Feat/SW-1472 destination tracking * feat(SW-1472): Added default tracking for destination overview page * feat(SW-1472): Added default tracking for destination country/city page * feat(SW-1472): moved tracking functions to different files for better overview * feat(SW-1472): added destination page tracking Approved-by: Fredrik Thorsson Approved-by: Matilda Landström
31 lines
574 B
TypeScript
31 lines
574 B
TypeScript
import { trackEvent } from "./base"
|
|
|
|
export function trackAccordionClick(option: string) {
|
|
trackEvent({
|
|
event: "accordionClick",
|
|
accordion: {
|
|
action: "accordion open click",
|
|
option,
|
|
},
|
|
})
|
|
}
|
|
|
|
export function trackOpenSidePeekEvent(
|
|
name: string | null,
|
|
hotelId: string,
|
|
pathName?: string,
|
|
roomTypeCode?: string | null
|
|
) {
|
|
trackEvent({
|
|
event: "openSidePeek",
|
|
hotelInfo: {
|
|
hotelId: hotelId,
|
|
},
|
|
cta: {
|
|
name,
|
|
...(roomTypeCode ? { roomTypeCode } : {}),
|
|
...(pathName ? { pathName } : {}),
|
|
},
|
|
})
|
|
}
|