diff --git a/core/components/RecoSlider.tsx b/core/components/RecoSlider.tsx index 528503eeeba9d4bd58254541bfe9fae27cfac559..1cfb8ab0b9afb786a772ba6efe1e69651bc66c47 100644 --- a/core/components/RecoSlider.tsx +++ b/core/components/RecoSlider.tsx @@ -64,6 +64,7 @@ const RecoSlider: React.FC<RecoSliderProps> = ({ const handleHeaderTitlePress = () => { if (seeAllPath) { + if (seeMoreTrackingEvent) track(seeMoreTrackingEvent) navigate(seeAllPath) } } diff --git a/core/layout/DetailsScreen/index.tsx b/core/layout/DetailsScreen/index.tsx index b003123c715051707e8a00b9c1cfdd3b67bf9501..00b7c46c0d172c6a662e31c86f13eaad0e81bfc5 100644 --- a/core/layout/DetailsScreen/index.tsx +++ b/core/layout/DetailsScreen/index.tsx @@ -18,8 +18,6 @@ import { AuthorBanner, type AuthorBannerProps } from 'holi-bricks/patterns/autho import { Spacing } from 'holi-bricks/tokens' import { DetailsScreenSkeleton } from '@holi/core/layout/DetailsScreen/skeleton' import { HtmlRenderer } from 'holi-bricks/components/html-renderer' -import { TextLinkTracked } from '@holi/core/components/Trackable' -import { TrackingEvent } from '@holi/core/tracking' import type { ImageSource } from 'holi-bricks/components/image' import { Avatar } from 'holi-bricks/components/avatar' @@ -162,7 +160,7 @@ export const DetailsScreen = ({ <Stack direction="column" gap="xxs" shouldRender={!!infoList}> {infoList?.map((detail, index) => { - const TextComp = detail.onPress ? TextLinkTracked : Text + const TextComp = detail.onPress ? TextLink : Text return ( <Stack alignItems="flex-start" @@ -174,9 +172,7 @@ export const DetailsScreen = ({ > <HoliIcon size={Spacing.md} icon={detail?.icon} /> <Stack flex={1}> - <TextComp size="md" trackingEvent={TrackingEvent.EventDetails.videoCall}> - {detail?.title} - </TextComp> + <TextComp size="md">{detail?.title}</TextComp> {detail?.subtitle && ( <Text color="support" size="sm"> {detail?.subtitle} diff --git a/core/tracking/events.ts b/core/tracking/events.ts index 3f9ee3c5f41c57bfab3e0b36685b0e0ccd7a0ef4..d0cd7d29348d7777e94e9cc22a90bf3ac64cc2ec 100644 --- a/core/tracking/events.ts +++ b/core/tracking/events.ts @@ -132,14 +132,24 @@ export namespace TrackingEvent { }, ...versionOne, }), + viewed: (eventId: string) => ({ + name: 'event_details_viewed', + properties: { + eventId, + }, + ...versionOne, + }), findMore: { name: 'events_findMore_pressed', ...versionOne, }, - videoCall: { + videoCall: (eventId: string) => ({ name: 'events_videoCallLink_pressed', + properties: { + eventId, + }, ...versionOne, - }, + }), } export const Events = { diff --git a/holi-apps/events/helpers/useEventDetailsData/useEventDetailsData.ts b/holi-apps/events/helpers/useEventDetailsData/useEventDetailsData.ts index 0008b0d0a554910fb7565c854dec7029988d549e..c384151c387f17902620e87382c588286ac083f4 100644 --- a/holi-apps/events/helpers/useEventDetailsData/useEventDetailsData.ts +++ b/holi-apps/events/helpers/useEventDetailsData/useEventDetailsData.ts @@ -84,7 +84,10 @@ export const useEventDetailsData = (eventId?: string): UseEventDetailsData => { title: remoteLink, icon: VideoChat, showExternalIcon: true, - onPress: () => Linking.openURL(remoteLink), + onPress: () => { + track(TrackingEvent.EventDetails.videoCall(event?.id as string)) + Linking.openURL(remoteLink) + }, }) } diff --git a/holi-apps/events/screens/EventDetails.tsx b/holi-apps/events/screens/EventDetails.tsx index 4027b6a84dbcad33183224ce3de4038a16613af0..67fd506eedd3fb627977a1e242d920455fe2a8d4 100644 --- a/holi-apps/events/screens/EventDetails.tsx +++ b/holi-apps/events/screens/EventDetails.tsx @@ -13,6 +13,7 @@ import { ExternalLink, Share } from '@holi/icons/src/generated' import { useTranslation } from 'react-i18next' import { HoliIcon } from '@holi/icons/src/HoliIcon' import { TrackingEvent } from '@holi/core/tracking' +import useTrackOnce from '@holi/core/tracking/hooks/useTrackOnce' export type EventDetailsParams = { eventId: string @@ -24,6 +25,9 @@ export const EventDetailsScreen = () => { const [eventId] = useParam('eventId') const { data, url: eventUrl, refetch, onShare } = useEventDetailsData(eventId as string) const { t } = useTranslation() + + useTrackOnce(TrackingEvent.EventDetails.viewed(eventId as string)) + return ( <Screen onRefresh={refetch}