Fix for webviews
This commit is contained in:
@@ -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