From 89a6d37c5b436b2a054a6102a3553fc8d325fb9b Mon Sep 17 00:00:00 2001 From: nikpachoo Date: Mon, 2 Feb 2026 19:09:45 +0100 Subject: [PATCH] ktl-3944 chore: add event tracking to choose-share tab clicks --- .../multiplatform/choose-share/blocks/what/index.tsx | 12 +++++++++++- .../choose-share/blocks/where/index.tsx | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/blocks/multiplatform/choose-share/blocks/what/index.tsx b/blocks/multiplatform/choose-share/blocks/what/index.tsx index 55d29a02511..80c39180504 100644 --- a/blocks/multiplatform/choose-share/blocks/what/index.tsx +++ b/blocks/multiplatform/choose-share/blocks/what/index.tsx @@ -9,6 +9,7 @@ import styles from './choose-share-what.module.css'; import { useTabScroll } from '../../hooks/useTabScroll'; import Link from 'next/link'; +import { trackEvent } from '../../../../../utils/event-logger'; const TABS_BLOCKS = [ { @@ -60,6 +61,14 @@ export function ChooseShareWhat({ className }: { className?: string }) { const navigateToHash = useTabScroll(TABS_BLOCKS, 'choose-share-what-', setActiveIndex); + const handleTabClick = (e: MouseEvent, tabId: string) => { + trackEvent({ + eventAction: 'kt_kmp_choose_what_to_share_click', + eventLabel: tabId, + }); + navigateToHash(e); + }; + return (

Choose what to share

@@ -78,7 +87,8 @@ export function ChooseShareWhat({ className }: { className?: string }) { id={`choose-share-what-${id}-tab`} role="tab" aria-controls={`choose-share-what-${id}-content`} href={`#choose-share-what-${id}`} aria-label={`Go to ${id} section`} - onClick={navigateToHash} data-testid={'share-what-chip-anchor'} + onClick={(e) => handleTabClick(e, id)} + data-testid={'share-what-chip-anchor'} {...(activeIndex === i && { 'aria-selected': true })} > diff --git a/blocks/multiplatform/choose-share/blocks/where/index.tsx b/blocks/multiplatform/choose-share/blocks/where/index.tsx index 632e0a6c252..7329cb18487 100644 --- a/blocks/multiplatform/choose-share/blocks/where/index.tsx +++ b/blocks/multiplatform/choose-share/blocks/where/index.tsx @@ -9,6 +9,7 @@ import styles from './choose-share-where.module.css'; import { useTabScroll } from '../../hooks/useTabScroll'; import Link from 'next/link'; +import { trackEvent } from '../../../../../utils/event-logger'; const TABS_BLOCKS = [ @@ -91,6 +92,14 @@ export function ChooseShareWhere({ className }: { className?: string }) { const navigateToHash = useTabScroll(TABS_BLOCKS, 'choose-share-where-', setActiveIndex); + const handleTabClick = (e: MouseEvent, tabId: string) => { + trackEvent({ + eventAction: 'kt_kmp_choose_where_to_share_click', + eventLabel: tabId + }); + navigateToHash(e); + }; + return (

Choose where to share

@@ -110,7 +119,8 @@ export function ChooseShareWhere({ className }: { className?: string }) { id={`choose-share-where-${id}-tab`} role="tab" aria-controls={`choose-share-where-${id}-pane`} className={styles.tab} aria-label={`Go to ${id} section`} - onClick={navigateToHash} {...(activeIndex === i && { 'aria-selected': true })}> + onClick={(e) => handleTabClick(e, id)} + {...(activeIndex === i && { 'aria-selected': true })}> {tab} ))}