From 0acb8707a36a6b6e6e6f4cd2ff056aac1794ee42 Mon Sep 17 00:00:00 2001 From: Dima Grossman Date: Sun, 8 Dec 2024 12:50:32 +0200 Subject: [PATCH] fix: add telemtry --- .../src/components/shared/external-link.tsx | 22 ++++++++++++++++++- apps/dashboard/src/utils/telemetry.ts | 1 + 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/src/components/shared/external-link.tsx b/apps/dashboard/src/components/shared/external-link.tsx index ade6bb1ecd4..483c083a4af 100644 --- a/apps/dashboard/src/components/shared/external-link.tsx +++ b/apps/dashboard/src/components/shared/external-link.tsx @@ -1,5 +1,7 @@ import { RiBookMarkedLine, RiExternalLinkLine, RiQuestionLine } from 'react-icons/ri'; import { cn } from '@/utils/ui'; +import { useTelemetry } from '@/hooks/use-telemetry'; +import { TelemetryEvent } from '@/utils/telemetry'; interface ExternalLinkProps extends React.AnchorHTMLAttributes { children: React.ReactNode; @@ -7,12 +9,30 @@ interface ExternalLinkProps extends React.AnchorHTMLAttributes { + telemetry(TelemetryEvent.EXTERNAL_LINK_CLICKED, { + href, + variant, + }); + }; + return ( {variant === 'documentation' &&