From f5eb98bc4f171cfa45d676de1a056ff4adeb7409 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Tue, 26 Mar 2024 13:57:05 +0100 Subject: [PATCH] Add analytics for Mark as read insight button --- src/components/Insights/common/InsightCard/index.tsx | 11 ++++++++++- src/components/Insights/tracking.ts | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/Insights/common/InsightCard/index.tsx b/src/components/Insights/common/InsightCard/index.tsx index 9fa90d68c..4026b9ef9 100644 --- a/src/components/Insights/common/InsightCard/index.tsx +++ b/src/components/Insights/common/InsightCard/index.tsx @@ -2,6 +2,7 @@ import React, { useContext, useEffect, useState } from "react"; import { actions as globalActions } from "../../../../actions"; import { getFeatureFlagValue } from "../../../../featureFlags"; import { usePrevious } from "../../../../hooks/usePrevious"; +import { trackingEvents as globalTrackingEvents } from "../../../../trackingEvents"; import { isString } from "../../../../typeGuards/isString"; import { FeatureFlag, GetInsightStatsPayload } from "../../../../types"; import { sendTrackingEvent } from "../../../../utils/sendTrackingEvent"; @@ -151,6 +152,14 @@ export const InsightCard = (props: InsightCardProps) => { show(); }; + const handleMarkAsReadButtonClick = () => { + sendTrackingEvent(globalTrackingEvents.USER_ACTION, { + action: trackingEvents.INSIGHT_CARD_MARK_AS_READ_BUTTON_CLICKED, + insightType: props.insight.type + }); + markAsRead(); + }; + const openTicketInfo = ( spanCodeObjectId: string | undefined, event: string @@ -197,7 +206,7 @@ export const InsightCard = (props: InsightCardProps) => {