fix: update page tracking properties
This commit is contained in:
@@ -40,19 +40,19 @@ function createPageObject(trackingData: TrackingData) {
|
||||
return sitesections
|
||||
}
|
||||
const sitesections = getSiteSections(segments)
|
||||
const { host: domain, href: pageurl } = window.location
|
||||
|
||||
const { host: domain, href: fullurl, origin } = window.location
|
||||
const page_obj = {
|
||||
pagename: trackingData.pageName,
|
||||
pagetype: trackingData.pageType,
|
||||
pageurl, // is window.location.href viable?
|
||||
pagename: segments.join('|'),
|
||||
pagetype: 'contentpage',
|
||||
pageurl: origin + trackingData.pathName,
|
||||
fullurl,
|
||||
createDate: trackingData.createdDate,
|
||||
publishDate: trackingData.publishedDate,
|
||||
domain, // is window.location.host viable?
|
||||
domain,
|
||||
errorcode: null, // handle
|
||||
querystring: trackingData.queryString || "",
|
||||
pageid: trackingData.pageId,
|
||||
sessionid: "<unique identifier of session>", // base on what?
|
||||
// sessionid: "<unique identifier of session>", // base on what?
|
||||
domainlanguage: lang,
|
||||
hotelbrand: "scandic",
|
||||
siteversion: "new-web",
|
||||
@@ -70,15 +70,6 @@ export default function Tracking({ pageData }: TrackingProps) {
|
||||
const pageObject = createPageObject(trackingData)
|
||||
|
||||
window.datalayer.page = pageObject
|
||||
|
||||
// NOTE: Is this irrelevant för drop 1?
|
||||
// var user_obj = {
|
||||
// loginstatus: "<if the user is logged in or not>",
|
||||
// memberid: "<unique meeting package membership id for the user>",
|
||||
// memberlevel: "<member level of user>",
|
||||
// }
|
||||
|
||||
// datalayer.user = user_obj;
|
||||
}, [pathName, queryString, pageData])
|
||||
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user