From cdb8291a557fee3505265c6fd102578b5168d713 Mon Sep 17 00:00:00 2001 From: Dzmitry Kosarau Date: Wed, 18 Oct 2023 18:27:35 +0500 Subject: [PATCH] EPMRPP-86260 || Update events for AA - Add new condition options in analyzed launch modal - Add new condition options in analyzer tab in project settings dropdown --- .../main/analytics/events/common/constants.js | 15 +++++++++++++++ .../events/ga4Events/projectSettingsPageEvents.js | 5 +++-- .../main/analytics/events/launchesPageEvents.js | 12 +----------- .../autoAnalysis/autoAnalysis.jsx | 2 +- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/app/src/components/main/analytics/events/common/constants.js b/app/src/components/main/analytics/events/common/constants.js index a6cbeaf444..04495fa513 100644 --- a/app/src/components/main/analytics/events/common/constants.js +++ b/app/src/components/main/analytics/events/common/constants.js @@ -14,4 +14,19 @@ * limitations under the License. */ +import { LAUNCH_ANALYZE_TYPES } from 'common/constants/launchAnalyzeTypes'; + export const GA_4_FIELD_LIMIT = 100; + +const { ANALYZER_MODE, ANALYZE_ITEMS_MODE } = LAUNCH_ANALYZE_TYPES; + +export const LAUNCH_ANALYZE_TYPES_TO_ANALYTICS_TITLES_MAP = { + [ANALYZE_ITEMS_MODE.TO_INVESTIGATE]: 'investigate_items', + [ANALYZE_ITEMS_MODE.AUTO_ANALYZED]: 'by_aa', + [ANALYZE_ITEMS_MODE.MANUALLY_ANALYZED]: 'manually', + [ANALYZER_MODE.ALL]: 'all_launches', + [ANALYZER_MODE.LAUNCH_NAME]: 'launches_with_the_same_name', + [ANALYZER_MODE.CURRENT_LAUNCH]: 'only_current_launch', + [ANALYZER_MODE.PREVIOUS_LAUNCH]: 'previous_launch_with_the_same_name', + [ANALYZER_MODE.CURRENT_AND_THE_SAME_NAME]: 'current_launch_and_launches_with_the_same_name', +}; diff --git a/app/src/components/main/analytics/events/ga4Events/projectSettingsPageEvents.js b/app/src/components/main/analytics/events/ga4Events/projectSettingsPageEvents.js index 886be58117..f710638495 100644 --- a/app/src/components/main/analytics/events/ga4Events/projectSettingsPageEvents.js +++ b/app/src/components/main/analytics/events/ga4Events/projectSettingsPageEvents.js @@ -15,6 +15,7 @@ */ import { normalizeEventString } from '../../utils'; +import { LAUNCH_ANALYZE_TYPES_TO_ANALYTICS_TITLES_MAP } from '../common/constants'; const PROJECT_SETTINGS = 'project_settings'; const ANALYZER = 'analyzer'; @@ -53,12 +54,12 @@ export const PROJECT_SETTINGS_ANALYZER_EVENTS = { status: getStatus(status), }), - CLICK_SUBMIT_IN_AUTO_ANALYZER_TAB: (number, status, type) => ({ + CLICK_SUBMIT_IN_AUTO_ANALYZER_TAB: (number, status, condition) => ({ ...BASIC_EVENT_PARAMETERS, place: `${ANALYZER}_auto_analyzer`, number, status: getStatus(status), - type: normalizeEventString(type), + condition: LAUNCH_ANALYZE_TYPES_TO_ANALYTICS_TITLES_MAP[condition], }), CLICK_SUBMIT_IN_SIMILAR_ITEMS_TAB: (number) => ({ diff --git a/app/src/components/main/analytics/events/launchesPageEvents.js b/app/src/components/main/analytics/events/launchesPageEvents.js index b372790a67..201502b10c 100644 --- a/app/src/components/main/analytics/events/launchesPageEvents.js +++ b/app/src/components/main/analytics/events/launchesPageEvents.js @@ -14,7 +14,6 @@ * limitations under the License. */ -import { LAUNCH_ANALYZE_TYPES } from 'common/constants/launchAnalyzeTypes'; import { getClickOnAnalyzeUniqueErrorsEventCreator, getEditItemsModalEvents, @@ -45,20 +44,11 @@ import { getSelectToggleButtonsAddWidgetModal, } from './common/widgetPages/actionEventCreators'; import { getBasicClickEventParameters } from './common/ga4Utils'; +import { LAUNCH_ANALYZE_TYPES_TO_ANALYTICS_TITLES_MAP } from './common/constants'; export const LAUNCHES_PAGE = 'launches'; const LAUNCHES_MODAL = 'Modal launches'; -const { ANALYZER_MODE, ANALYZE_ITEMS_MODE } = LAUNCH_ANALYZE_TYPES; - -const LAUNCH_ANALYZE_TYPES_TO_ANALYTICS_TITLES_MAP = { - [ANALYZE_ITEMS_MODE.TO_INVESTIGATE]: 'investigate_items', - [ANALYZE_ITEMS_MODE.AUTO_ANALYZED]: 'by_aa', - [ANALYZE_ITEMS_MODE.MANUALLY_ANALYZED]: 'manually', - [ANALYZER_MODE.ALL]: 'all_launches', - [ANALYZER_MODE.LAUNCH_NAME]: 'launches_with_the_same_name', - [ANALYZER_MODE.CURRENT_LAUNCH]: 'only_current_launch', -}; const formatAnalyzeItemsMode = (modes) => modes.map((mode) => LAUNCH_ANALYZE_TYPES_TO_ANALYTICS_TITLES_MAP[mode]).join('#'); diff --git a/app/src/pages/inside/projectSettingsPageContainer/content/analyzerContainer/autoAnalysis/autoAnalysis.jsx b/app/src/pages/inside/projectSettingsPageContainer/content/analyzerContainer/autoAnalysis/autoAnalysis.jsx index 9d40f94223..ca968327be 100644 --- a/app/src/pages/inside/projectSettingsPageContainer/content/analyzerContainer/autoAnalysis/autoAnalysis.jsx +++ b/app/src/pages/inside/projectSettingsPageContainer/content/analyzerContainer/autoAnalysis/autoAnalysis.jsx @@ -103,7 +103,7 @@ const AutoAnalysis = ({ PROJECT_SETTINGS_ANALYZER_EVENTS.CLICK_SUBMIT_IN_AUTO_ANALYZER_TAB( data[MIN_SHOULD_MATCH], data[ANALYZER_ENABLED], - data[ANALYZER_MODE] === 'ALL' ? 'All' : messages.sameNameLaunchesCaption.defaultMessage, + data[ANALYZER_MODE], ), );