Fix for webviews

This commit is contained in:
Linus Flood
2024-10-17 12:50:32 +02:00
parent 582c852377
commit 42640abb2b
3 changed files with 20 additions and 10 deletions

View File

@@ -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.
}
}