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 LangPopup from "@/components/Current/LangPopup"
|
||||
import SkipToMainContent from "@/components/SkipToMainContent"
|
||||
import RouterTracking from "@/components/TrackingSDK/RouterTracking"
|
||||
import { getIntl } from "@/i18n"
|
||||
import ServerIntlProvider from "@/i18n/Provider"
|
||||
import { setLang } from "@/i18n/serverContext"
|
||||
@@ -65,12 +66,14 @@ export default async function RootLayout({
|
||||
<LangPopup />
|
||||
<SkipToMainContent />
|
||||
<ServerIntlProvider intl={{ defaultLocale, locale, messages }}>
|
||||
{header}
|
||||
<BookingWidget />
|
||||
{children}
|
||||
<Footer />
|
||||
<TokenRefresher />
|
||||
<CookieBotConsent />
|
||||
<RouterTracking>
|
||||
{header}
|
||||
<BookingWidget />
|
||||
{children}
|
||||
<Footer />
|
||||
<TokenRefresher />
|
||||
<CookieBotConsent />
|
||||
</RouterTracking>
|
||||
</ServerIntlProvider>
|
||||
<Script id="page-tracking">{`
|
||||
typeof _satellite !== "undefined" && _satellite.pageBottom();
|
||||
|
||||
@@ -7,6 +7,7 @@ import TrpcProvider from "@/lib/trpc/Provider"
|
||||
|
||||
import AdobeSDKScript from "@/components/Current/AdobeSDKScript"
|
||||
import GTMScript from "@/components/Current/GTMScript"
|
||||
import RouterTracking from "@/components/TrackingSDK/RouterTracking"
|
||||
import { getIntl } from "@/i18n"
|
||||
import ServerIntlProvider from "@/i18n/Provider"
|
||||
import { setLang } from "@/i18n/serverContext"
|
||||
@@ -39,7 +40,9 @@ export default async function RootLayout({
|
||||
</head>
|
||||
<body className={styles.layout}>
|
||||
<ServerIntlProvider intl={{ defaultLocale, locale, messages }}>
|
||||
<TrpcProvider>{children}</TrpcProvider>
|
||||
<TrpcProvider>
|
||||
<RouterTracking>{children}</RouterTracking>
|
||||
</TrpcProvider>
|
||||
</ServerIntlProvider>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -39,12 +39,16 @@ export function trackLoginClick(position: TrackingPosition) {
|
||||
export function createSDKPageObject(
|
||||
trackingData: TrackingSDKData
|
||||
): TrackingSDKData {
|
||||
const siteSections =
|
||||
trackingData.pageName?.split("/").slice(1).join("|") ?? ""
|
||||
let pageName = trackingData.pageName?.split("/").slice(1).join("|") ?? ""
|
||||
|
||||
if (trackingData.pathName.indexOf("/webview/") > -1) {
|
||||
pageName = "webview|" + pageName
|
||||
}
|
||||
|
||||
return {
|
||||
...trackingData,
|
||||
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