From ea98e4e075e0e81cb5461553cbc4193c0ae482b2 Mon Sep 17 00:00:00 2001 From: akash-codemonk <67054171+akash-codemonk@users.noreply.github.com> Date: Wed, 20 Oct 2021 17:10:29 +0530 Subject: [PATCH] chore: add analytics event for debugger context menu click (#8628) --- .../editorComponents/Debugger/ContextualMenu.tsx | 15 +++++++++++++++ app/client/src/utils/AnalyticsUtil.tsx | 1 + 2 files changed, 16 insertions(+) diff --git a/app/client/src/components/editorComponents/Debugger/ContextualMenu.tsx b/app/client/src/components/editorComponents/Debugger/ContextualMenu.tsx index 89112646a1..1705de3311 100644 --- a/app/client/src/components/editorComponents/Debugger/ContextualMenu.tsx +++ b/app/client/src/components/editorComponents/Debugger/ContextualMenu.tsx @@ -156,6 +156,9 @@ const searchAction: Record< icon: "duplicate", text: createMessage(DEBUGGER_COPY_MESSAGE), onSelect: (error: Message) => { + AnalyticsUtil.logEvent("DEBUGGER_CONTEXT_MENU_CLICK", { + menuItem: CONTEXT_MENU_ACTIONS.COPY, + }); copy(error.message); }, }, @@ -163,6 +166,9 @@ const searchAction: Record< icon: "share-2", text: createMessage(DEBUGGER_SEARCH_GOOGLE), onSelect: (error: Message) => { + AnalyticsUtil.logEvent("DEBUGGER_CONTEXT_MENU_CLICK", { + menuItem: CONTEXT_MENU_ACTIONS.GOOGLE, + }); window.open("http://google.com/search?q=" + error.message); }, }, @@ -170,6 +176,9 @@ const searchAction: Record< icon: "book-line", text: createMessage(DEBUGGER_OPEN_DOCUMENTATION), onSelect: (error: Message, dispatch: Dispatch) => { + AnalyticsUtil.logEvent("DEBUGGER_CONTEXT_MENU_CLICK", { + menuItem: CONTEXT_MENU_ACTIONS.DOCS, + }); // Search through the omnibar AnalyticsUtil.logEvent("OPEN_OMNIBAR", { source: "DEBUGGER", @@ -186,6 +195,9 @@ const searchAction: Record< icon: "support", text: createMessage(DEBUGGER_APPSMITH_SUPPORT), onSelect: (error: Message) => { + AnalyticsUtil.logEvent("DEBUGGER_CONTEXT_MENU_CLICK", { + menuItem: CONTEXT_MENU_ACTIONS.INTERCOM, + }); // Search through the omnibar if (intercomAppID && window.Intercom) { window.Intercom( @@ -199,6 +211,9 @@ const searchAction: Record< icon: "play", text: createMessage(DEBUGGER_SEARCH_SNIPPET), onSelect: (error: Message, dispatch: Dispatch, entity) => { + AnalyticsUtil.logEvent("DEBUGGER_CONTEXT_MENU_CLICK", { + menuItem: CONTEXT_MENU_ACTIONS.SNIPPET, + }); /// Search through the omnibar AnalyticsUtil.logEvent("OPEN_OMNIBAR", { source: "DEBUGGER", diff --git a/app/client/src/utils/AnalyticsUtil.tsx b/app/client/src/utils/AnalyticsUtil.tsx index a79eca6377..8b59695d7f 100644 --- a/app/client/src/utils/AnalyticsUtil.tsx +++ b/app/client/src/utils/AnalyticsUtil.tsx @@ -131,6 +131,7 @@ export type EventName = | "DEBUGGER_RESOLVED_ERROR" | "DEBUGGER_NEW_ERROR_MESSAGE" | "DEBUGGER_RESOLVED_ERROR_MESSAGE" + | "DEBUGGER_CONTEXT_MENU_CLICK" | "ADD_MOCK_DATASOURCE_CLICK" | "CREATE_DATA_SOURCE_AUTH_API_CLICK" | "GEN_CRUD_PAGE_CREATE_NEW_DATASOURCE"