80 lines
1.6 KiB
TypeScript
80 lines
1.6 KiB
TypeScript
import { MembershipLevel } from "@/constants/membershipLevels"
|
|
|
|
import type { Lang } from "@/constants/languages"
|
|
|
|
export enum TrackingChannelEnum {
|
|
"scandic-friends" = "scandic-friends",
|
|
}
|
|
|
|
export type TrackingChannel = keyof typeof TrackingChannelEnum
|
|
|
|
export type TrackingSDKPageData = {
|
|
pageId: string
|
|
createdDate: string
|
|
publishedDate: string
|
|
lang: Lang
|
|
pageType: string
|
|
channel: TrackingChannel
|
|
}
|
|
|
|
export enum LoginTypeEnum {
|
|
email = "email",
|
|
"membership number" = "membership number",
|
|
"email link" = "email link",
|
|
}
|
|
export type LoginType = keyof typeof LoginTypeEnum
|
|
|
|
export type TrackingSDKUserData = {
|
|
loginStatus: "logged in" | "Non-logged in"
|
|
loginType?: LoginType
|
|
memberId?: string
|
|
memberLevel?: MembershipLevel
|
|
noOfNightsStayed?: number
|
|
totalPointsAvailableToSpend?: number
|
|
loginAction?: "login success"
|
|
}
|
|
|
|
export type TrackingSDKProps = {
|
|
pageData: TrackingSDKPageData
|
|
userData: TrackingSDKUserData
|
|
}
|
|
|
|
export type TrackingSDKData = TrackingSDKPageData & {
|
|
pathName: string
|
|
}
|
|
|
|
// Old tracking setup types:
|
|
export type TrackingProps = {
|
|
pageData: {
|
|
pageId: string
|
|
createdDate: string
|
|
publishedDate: string
|
|
englishUrl?: string
|
|
lang: Lang
|
|
}
|
|
}
|
|
|
|
export type TrackingData = {
|
|
lang: Lang
|
|
englishUrl?: string
|
|
pathName: string
|
|
queryString: string
|
|
pageId: string
|
|
publishedDate: string
|
|
createdDate: string
|
|
}
|
|
|
|
export type SiteSectionObject = {
|
|
sitesection1: string
|
|
sitesection2: string
|
|
sitesection3: string
|
|
sitesection4: string
|
|
sitesection5: string
|
|
sitesection6: string
|
|
}
|
|
|
|
export type TrackingPosition =
|
|
| "top menu"
|
|
| "hamburger menu"
|
|
| "join scandic friends sidebar"
|