From f1eb27997b5dddd955ae688ba80c1041c9926448 Mon Sep 17 00:00:00 2001 From: Rushikesh-Sonawane99 Date: Tue, 13 Aug 2024 15:50:24 +0530 Subject: [PATCH] Issue #PS-1636 chore: Added GA events for tracking create session success and failur --- src/components/AddFacilitator.tsx | 2 +- src/components/PlannedSession.tsx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/AddFacilitator.tsx b/src/components/AddFacilitator.tsx index 98acee96..4edeb12d 100644 --- a/src/components/AddFacilitator.tsx +++ b/src/components/AddFacilitator.tsx @@ -274,7 +274,7 @@ const AddFacilitatorModal: React.FC = ({ 'success' ); ReactGA.event('facilitator-created-successfully', { - user_name: username, + userName: username, }); const isQueue = false; diff --git a/src/components/PlannedSession.tsx b/src/components/PlannedSession.tsx index 61d5d086..0fdbe9c6 100644 --- a/src/components/PlannedSession.tsx +++ b/src/components/PlannedSession.tsx @@ -45,6 +45,7 @@ import { import SessionMode from './SessionMode'; import { showToastMessage } from './Toastify'; import WeekDays from './WeekDays'; +import ReactGA from 'react-ga4'; type mode = (typeof sessionMode)[keyof typeof sessionMode]; type type = (typeof sessionType)[keyof typeof sessionType]; @@ -627,6 +628,9 @@ const PlannedSession: React.FC = ({ t('COMMON.SESSION_SCHEDULED_SUCCESSFULLY'), 'sucess' ); + ReactGA.event('event-created-successfully', { + creatorId: userId, + }); if (onCloseModal) { onCloseModal(); } @@ -641,6 +645,9 @@ const PlannedSession: React.FC = ({ ); } catch (error) { console.error('Error scheduling new event:', error); + ReactGA.event('event-creation-fail', { + error: error, + }); } };