Fix for webviews
This commit is contained in:
@@ -10,6 +10,7 @@ import AdobeScript from "@/components/Current/AdobeScript"
|
|||||||
import Footer from "@/components/Current/Footer"
|
import Footer from "@/components/Current/Footer"
|
||||||
import LangPopup from "@/components/Current/LangPopup"
|
import LangPopup from "@/components/Current/LangPopup"
|
||||||
import SkipToMainContent from "@/components/SkipToMainContent"
|
import SkipToMainContent from "@/components/SkipToMainContent"
|
||||||
|
import RouterTracking from "@/components/TrackingSDK/RouterTracking"
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
import ServerIntlProvider from "@/i18n/Provider"
|
import ServerIntlProvider from "@/i18n/Provider"
|
||||||
import { setLang } from "@/i18n/serverContext"
|
import { setLang } from "@/i18n/serverContext"
|
||||||
@@ -65,12 +66,14 @@ export default async function RootLayout({
|
|||||||
<LangPopup />
|
<LangPopup />
|
||||||
<SkipToMainContent />
|
<SkipToMainContent />
|
||||||
<ServerIntlProvider intl={{ defaultLocale, locale, messages }}>
|
<ServerIntlProvider intl={{ defaultLocale, locale, messages }}>
|
||||||
{header}
|
<RouterTracking>
|
||||||
<BookingWidget />
|
{header}
|
||||||
{children}
|
<BookingWidget />
|
||||||
<Footer />
|
{children}
|
||||||
<TokenRefresher />
|
<Footer />
|
||||||
<CookieBotConsent />
|
<TokenRefresher />
|
||||||
|
<CookieBotConsent />
|
||||||
|
</RouterTracking>
|
||||||
</ServerIntlProvider>
|
</ServerIntlProvider>
|
||||||
<Script id="page-tracking">{`
|
<Script id="page-tracking">{`
|
||||||
typeof _satellite !== "undefined" && _satellite.pageBottom();
|
typeof _satellite !== "undefined" && _satellite.pageBottom();
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import TrpcProvider from "@/lib/trpc/Provider"
|
|||||||
|
|
||||||
import AdobeSDKScript from "@/components/Current/AdobeSDKScript"
|
import AdobeSDKScript from "@/components/Current/AdobeSDKScript"
|
||||||
import GTMScript from "@/components/Current/GTMScript"
|
import GTMScript from "@/components/Current/GTMScript"
|
||||||
|
import RouterTracking from "@/components/TrackingSDK/RouterTracking"
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
import ServerIntlProvider from "@/i18n/Provider"
|
import ServerIntlProvider from "@/i18n/Provider"
|
||||||
import { setLang } from "@/i18n/serverContext"
|
import { setLang } from "@/i18n/serverContext"
|
||||||
@@ -39,7 +40,9 @@ export default async function RootLayout({
|
|||||||
</head>
|
</head>
|
||||||
<body className={styles.layout}>
|
<body className={styles.layout}>
|
||||||
<ServerIntlProvider intl={{ defaultLocale, locale, messages }}>
|
<ServerIntlProvider intl={{ defaultLocale, locale, messages }}>
|
||||||
<TrpcProvider>{children}</TrpcProvider>
|
<TrpcProvider>
|
||||||
|
<RouterTracking>{children}</RouterTracking>
|
||||||
|
</TrpcProvider>
|
||||||
</ServerIntlProvider>
|
</ServerIntlProvider>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -39,12 +39,16 @@ export function trackLoginClick(position: TrackingPosition) {
|
|||||||
export function createSDKPageObject(
|
export function createSDKPageObject(
|
||||||
trackingData: TrackingSDKData
|
trackingData: TrackingSDKData
|
||||||
): TrackingSDKData {
|
): TrackingSDKData {
|
||||||
const siteSections =
|
let pageName = trackingData.pageName?.split("/").slice(1).join("|") ?? ""
|
||||||
trackingData.pageName?.split("/").slice(1).join("|") ?? ""
|
|
||||||
|
if (trackingData.pathName.indexOf("/webview/") > -1) {
|
||||||
|
pageName = "webview|" + pageName
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...trackingData,
|
...trackingData,
|
||||||
domain: window.location.host,
|
domain: window.location.host,
|
||||||
siteSections: siteSections,
|
pageName: pageName,
|
||||||
|
siteSections: pageName, // TODO: We need to support other siteSections values in some cases.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user