Feat/SW-1472 destination tracking * feat(SW-1472): Added default tracking for destination overview page * feat(SW-1472): Added default tracking for destination country/city page * feat(SW-1472): moved tracking functions to different files for better overview * feat(SW-1472): added destination page tracking Approved-by: Fredrik Thorsson Approved-by: Matilda Landström
33 lines
661 B
TypeScript
33 lines
661 B
TypeScript
import { trackEvent } from "./base"
|
|
|
|
import type { TrackingPosition } from "@/types/components/tracking"
|
|
|
|
export function trackFooterClick(group: string, name: string) {
|
|
trackEvent({
|
|
event: "footer link",
|
|
footer: {
|
|
footerLinkClicked: `${group}:${name}`,
|
|
},
|
|
})
|
|
}
|
|
|
|
export function trackSocialMediaClick(socialMediaName: string) {
|
|
trackEvent({
|
|
event: "social media",
|
|
social: {
|
|
socialIconClicked: socialMediaName,
|
|
},
|
|
})
|
|
}
|
|
|
|
export function trackLoginClick(position: TrackingPosition) {
|
|
trackEvent({
|
|
event: "loginStart",
|
|
login: {
|
|
position,
|
|
action: "login start",
|
|
ctaName: "login",
|
|
},
|
|
})
|
|
}
|