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