feat(SW-392): Added map click tracking
This commit is contained in:
@@ -9,6 +9,7 @@ import Button from "@/components/TempDesignSystem/Button"
|
||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
import { trackHotelMapClick } from "@/utils/tracking"
|
||||
|
||||
import styles from "./mapCard.module.css"
|
||||
|
||||
@@ -18,6 +19,11 @@ export default function MapCard({ hotelName, pois }: MapCardProps) {
|
||||
const intl = useIntl()
|
||||
const { openDynamicMap } = useHotelPageStore()
|
||||
|
||||
function handleOpenMapClick() {
|
||||
openDynamicMap()
|
||||
trackHotelMapClick()
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.mapCard}>
|
||||
<Caption
|
||||
@@ -56,7 +62,7 @@ export default function MapCard({ hotelName, pois }: MapCardProps) {
|
||||
intent="secondary"
|
||||
size="small"
|
||||
fullWidth
|
||||
onClick={openDynamicMap}
|
||||
onClick={handleOpenMapClick}
|
||||
>
|
||||
{intl.formatMessage({ id: "Explore nearby" })}
|
||||
</Button>
|
||||
|
||||
@@ -52,6 +52,16 @@ export function trackFooterClick(group: string, name: string) {
|
||||
pushToDataLayer(event)
|
||||
}
|
||||
|
||||
export function trackHotelMapClick() {
|
||||
const event = {
|
||||
event: "map click",
|
||||
map: {
|
||||
action: "map click – open/explore mearby",
|
||||
},
|
||||
}
|
||||
pushToDataLayer(event)
|
||||
}
|
||||
|
||||
export function trackUpdatePaymentMethod(hotelId: string, method: string) {
|
||||
const paymentSelectionEvent = {
|
||||
event: "paymentSelection",
|
||||
|
||||
Reference in New Issue
Block a user