Merge remote-tracking branch 'origin' into feat/tracking-payment
This commit is contained in:
@@ -20,7 +20,7 @@ export function trackPageViewStart() {
|
||||
}
|
||||
|
||||
export function trackLoginClick(position: TrackingPosition) {
|
||||
const loginEvent = {
|
||||
const event = {
|
||||
event: "loginStart",
|
||||
login: {
|
||||
position,
|
||||
@@ -28,7 +28,27 @@ export function trackLoginClick(position: TrackingPosition) {
|
||||
ctaName: "login",
|
||||
},
|
||||
}
|
||||
pushToDataLayer(loginEvent)
|
||||
pushToDataLayer(event)
|
||||
}
|
||||
|
||||
export function trackSocialMediaClick(socialMediaName: string) {
|
||||
const event = {
|
||||
event: "social media",
|
||||
social: {
|
||||
socialIconClicked: socialMediaName,
|
||||
},
|
||||
}
|
||||
pushToDataLayer(event)
|
||||
}
|
||||
|
||||
export function trackFooterClick(group: string, name: string) {
|
||||
const event = {
|
||||
event: "footer link",
|
||||
footer: {
|
||||
footerLinkClicked: `${group}:${name}`,
|
||||
},
|
||||
}
|
||||
pushToDataLayer(event)
|
||||
}
|
||||
|
||||
export function trackUpdatePaymentMethod(hotelId: string, method: string) {
|
||||
@@ -80,7 +100,7 @@ export function createSDKPageObject(
|
||||
|
||||
return {
|
||||
...trackingData,
|
||||
domain: window.location.host,
|
||||
domain: typeof window !== "undefined" ? window.location.host : "",
|
||||
pageName: pageName,
|
||||
siteSections: siteSections,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user