feat(SW-1472): adjustments to destination page tracking
Approved-by: Matilda Landström
This commit is contained in:
@@ -17,12 +17,17 @@ export default function DestinationTracking({
|
||||
}: DestinationTrackingProps) {
|
||||
const searchParams = useSearchParams()
|
||||
const isMapView = searchParams.get("view") === "map"
|
||||
const pagetype =
|
||||
pageData.pageType === "countrypage"
|
||||
? "countrymapviewpage"
|
||||
: "citymapviewpage"
|
||||
const pagename = `${pageData.pageName}|map-view`
|
||||
|
||||
useEffect(() => {
|
||||
if (isMapView) {
|
||||
trackOpenMapView(pageData.pageName, pageData.pageType)
|
||||
trackOpenMapView(pagename, pagetype)
|
||||
}
|
||||
}, [isMapView, pageData.pageName, pageData.pageType])
|
||||
}, [isMapView, pagename, pagetype])
|
||||
|
||||
return <TrackingSDK pageData={pageData} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user