From 0a803778f4e0296ea43f799aa077b4b59dc28be4 Mon Sep 17 00:00:00 2001 From: "Heiko W. Rupp" Date: Tue, 11 Jun 2024 12:09:08 +0200 Subject: [PATCH] [RHOAIENG-8414] Tracking of dashboard version in Segment. --- frontend/src/utilities/segmentIOUtils.tsx | 30 ++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/frontend/src/utilities/segmentIOUtils.tsx b/frontend/src/utilities/segmentIOUtils.tsx index 3f4484c7ec..4b7d244c35 100644 --- a/frontend/src/utilities/segmentIOUtils.tsx +++ b/frontend/src/utilities/segmentIOUtils.tsx @@ -15,7 +15,15 @@ export const fireTrackingEventRaw = (eventType: string, properties?: any): void }`, ); } else if (window.analytics) { - window.analytics.track(eventType, { ...properties, clusterID }); + window.analytics.track( + eventType, + { ...properties, clusterID }, + { + app: { + version: INTERNAL_DASHBOARD_VERSION, + }, + }, + ); } }; @@ -39,10 +47,26 @@ export const fireTrackingEvent = ( window.analytics.identify(properties?.anonymousID, { clusterID }); break; case 'page': - window.analytics.page(undefined, { clusterID }); + window.analytics.page( + undefined, + { clusterID }, + { + app: { + version: INTERNAL_DASHBOARD_VERSION, + }, + }, + ); break; default: - window.analytics.track(eventType, { ...properties, clusterID }); + window.analytics.track( + eventType, + { ...properties, clusterID }, + { + app: { + version: INTERNAL_DASHBOARD_VERSION, + }, + }, + ); } } };