Skip to content

Commit

Permalink
EPMRPP-88921 || Extra event is sent to GA when clicking on Submit but…
Browse files Browse the repository at this point in the history
…ton (#3720)

* EPMRPP-88921 || Extra event is sent to GA when clicking on Submit button

* EPMRPP-88921 || Code Review fix - 1
  • Loading branch information
BlazarQSO authored Jan 12, 2024
1 parent e4a9079 commit a4f4584
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,15 @@ const getStatus = (status) => (status ? 'active' : 'disabled');
const getSwitcher = (switcher) => (switcher ? 'on' : 'off');

export const PROJECT_SETTINGS_ANALYZER_EVENTS = {
clickSubmitInIndexTab: (number, status) => ({
...BASIC_EVENT_PARAMETERS_ANALYZER_TAB,
element_name: 'button_submit',
place: `${ANALYZER}_index_settings`,
number,
status: getStatus(status),
}),

clickSubmitInAutoAnalyzerTab: (number, status, condition) => ({
clickSubmitInAutoAnalyzerTab: (number, status, condition, switcher, type) => ({
...BASIC_EVENT_PARAMETERS_ANALYZER_TAB,
place: `${ANALYZER}_auto_analyzer`,
element_name: 'button_submit',
number,
status: getStatus(status),
condition: LAUNCH_ANALYZE_TYPES_TO_ANALYTICS_TITLES_MAP[condition],
switcher,
type,
}),

clickSubmitInSimilarItemsTab: (number) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,15 @@ const AutoAnalysis = ({
await onFormSubmit(data);
setPending(false);

const numberOfLogLines = data[NUMBER_OF_LOG_LINES] === '-1' ? 'all' : data[NUMBER_OF_LOG_LINES];

trackEvent(
PROJECT_SETTINGS_ANALYZER_EVENTS.clickSubmitInAutoAnalyzerTab(
data[MIN_SHOULD_MATCH],
data[ANALYZER_ENABLED],
data[ANALYZER_MODE],
),
);

const numberOfLogLines = data[NUMBER_OF_LOG_LINES] === '-1' ? 'all' : data[NUMBER_OF_LOG_LINES];

trackEvent(
PROJECT_SETTINGS_ANALYZER_EVENTS.clickSubmitInIndexTab(
numberOfLogLines,
data[ALL_MESSAGES_SHOULD_MATCH],
numberOfLogLines,
),
);
};
Expand Down

0 comments on commit a4f4584

Please sign in to comment.