diff --git a/apps/scandic-web/components/ContentType/DestinationPage/Tracking/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/Tracking/index.tsx index d5ec8a6db..4c0e91519 100644 --- a/apps/scandic-web/components/ContentType/DestinationPage/Tracking/index.tsx +++ b/apps/scandic-web/components/ContentType/DestinationPage/Tracking/index.tsx @@ -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 } diff --git a/apps/scandic-web/server/routers/contentstack/destinationCityPage/query.ts b/apps/scandic-web/server/routers/contentstack/destinationCityPage/query.ts index 56a862755..7987b494a 100644 --- a/apps/scandic-web/server/routers/contentstack/destinationCityPage/query.ts +++ b/apps/scandic-web/server/routers/contentstack/destinationCityPage/query.ts @@ -182,7 +182,7 @@ export const destinationCityPageQueryRouter = router({ ) const system = destinationCityPage.system - const pageName = `hotels|${city.country ? `${city.country}|` : ""}${city.name}` + const pageName = `destinations|${city.country}|${city.name}` const tracking: TrackingSDKPageData = { pageId: system.uid, diff --git a/apps/scandic-web/server/routers/contentstack/destinationCountryPage/query.ts b/apps/scandic-web/server/routers/contentstack/destinationCountryPage/query.ts index 364d5fd6f..6712c85b7 100644 --- a/apps/scandic-web/server/routers/contentstack/destinationCountryPage/query.ts +++ b/apps/scandic-web/server/routers/contentstack/destinationCountryPage/query.ts @@ -167,7 +167,7 @@ export const destinationCountryPageQueryRouter = router({ ) const system = destinationCountryPage.system - const pageName = `hotels|${country}` + const pageName = `destinations|${country}` const tracking: TrackingSDKPageData = { pageId: system.uid, diff --git a/apps/scandic-web/server/routers/contentstack/destinationOverviewPage/query.ts b/apps/scandic-web/server/routers/contentstack/destinationOverviewPage/query.ts index 11e230c55..c9ddc24df 100644 --- a/apps/scandic-web/server/routers/contentstack/destinationOverviewPage/query.ts +++ b/apps/scandic-web/server/routers/contentstack/destinationOverviewPage/query.ts @@ -188,8 +188,8 @@ export const destinationOverviewPageQueryRouter = router({ createDate: system.created_at, channel: TrackingChannelEnum.hotels, pageType: "destinationoverviewpage", - pageName: "destination|overview", - siteSections: "destination|overview", + pageName: "destinations|overview", + siteSections: "destinations|overview", siteVersion: "new-web", } diff --git a/apps/scandic-web/utils/tracking/destinationPage.ts b/apps/scandic-web/utils/tracking/destinationPage.ts index d496e46cc..bff8f29cf 100644 --- a/apps/scandic-web/utils/tracking/destinationPage.ts +++ b/apps/scandic-web/utils/tracking/destinationPage.ts @@ -48,12 +48,12 @@ export function trackMapClick(name: string) { }) } -export function trackOpenMapView(pageName: string, pageType: string) { +export function trackOpenMapView(pagename: string, pagetype: string) { trackEvent({ event: "openMapView", map: { - pageName, - pageType, + pagename, + pagetype, }, }) }