Merged in fix/SW-2676-tracking-select-hotel (pull request #2165)

Fix/SW-2676 tracking select hotel

* fix(SW-2676): add tracking select hotel

* fix(SW-2676): fix tracking text

* fix(SW-2676): create tracking function


Approved-by: Tobias Johansson
This commit is contained in:
Bianca Widstam
2025-05-22 11:44:47 +00:00
parent cc34cdcf74
commit 3e0190d5e7
4 changed files with 58 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ import { useCallback } from "react"
import { useIntl } from "react-intl"
import Select from "@/components/TempDesignSystem/Select"
import { trackEvent } from "@/utils/tracking/base"
import {
type HotelSorterProps,
@@ -28,7 +29,12 @@ export default function HotelSorter({ discreet }: HotelSorterProps) {
const newSearchParams = new URLSearchParams(searchParams)
newSearchParams.set("sort", newSort)
trackEvent({
event: "sortOptionClick",
filter: {
sortOptions: newSort,
},
})
window.history.replaceState(
null,
"",