Skip to content

Commit

Permalink
EPMRPP-86260 || Update events for AA
Browse files Browse the repository at this point in the history
- Add new condition options in analyzed launch modal
- Add new condition options in analyzer tab in project settings dropdown
  • Loading branch information
Dzmitry Kosarau authored and Dzmitry Kosarau committed Oct 18, 2023
1 parent 841163a commit cdb8291
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
15 changes: 15 additions & 0 deletions app/src/components/main/analytics/events/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) => ({
Expand Down
12 changes: 1 addition & 11 deletions app/src/components/main/analytics/events/launchesPageEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

import { LAUNCH_ANALYZE_TYPES } from 'common/constants/launchAnalyzeTypes';
import {
getClickOnAnalyzeUniqueErrorsEventCreator,
getEditItemsModalEvents,
Expand Down Expand Up @@ -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('#');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
),
);

Expand Down

0 comments on commit cdb8291

Please sign in to comment.