Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMRPP-86260 || Update events for AA #3612

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading