diff --git a/app/src/components/main/analytics/events/adminServerSettingsPageEvents.js b/app/src/components/main/analytics/events/adminServerSettingsPageEvents.js index 5fdca71142..c290f7527b 100644 --- a/app/src/components/main/analytics/events/adminServerSettingsPageEvents.js +++ b/app/src/components/main/analytics/events/adminServerSettingsPageEvents.js @@ -29,15 +29,21 @@ export const submitAnalyticsBtn = (status) => ({ }); export const ADMIN_SERVER_SETTINGS_PAGE_EVENTS = { + toggleSsoUsers: (switcherValue) => ({ + ...basicClickEventParametersAdminServerSettingsPage, + element_name: 'sso', + switcher: switcherValue ? 'on' : 'off', + }), + ANALYTICS_TAB: { + ...basicClickEventParametersAdminServerSettingsPage, + element_name: 'analytics', + }, + // GA3 events AUTHORIZATION_CONFIGURATION_TAB: { category: ADMIN_SERVER_SETTINGS_PAGE, action: 'Click on tab Authorization Configuration', label: 'Open tab Authorization Configuration', }, - ANALYTICS_TAB: { - ...basicClickEventParametersAdminServerSettingsPage, - element_name: 'analytics', - }, ACTIVATE_GITHUB_SWITCHER: { category: ADMIN_SERVER_SETTINGS_PAGE, action: 'Click on switcher Activate Github authorization on tab Authorization Configuration', diff --git a/app/src/pages/admin/serverSettingsPage/serverSettingsTabs/authConfigurationTab/forms/ssoUsersForm/ssoUsersForm.jsx b/app/src/pages/admin/serverSettingsPage/serverSettingsTabs/authConfigurationTab/forms/ssoUsersForm/ssoUsersForm.jsx index e246aabbc1..44e92353cb 100644 --- a/app/src/pages/admin/serverSettingsPage/serverSettingsTabs/authConfigurationTab/forms/ssoUsersForm/ssoUsersForm.jsx +++ b/app/src/pages/admin/serverSettingsPage/serverSettingsTabs/authConfigurationTab/forms/ssoUsersForm/ssoUsersForm.jsx @@ -26,6 +26,7 @@ import { showSuccessNotification, showErrorNotification } from 'controllers/noti import formStyles from 'pages/admin/serverSettingsPage/common/formController/formController.scss'; import { fetch } from 'common/utils/fetch'; import { URLS } from 'common/urls'; +import { useTracking } from 'react-tracking'; import styles from './ssoUsersForm.scss'; const formCx = classNames.bind(formStyles); @@ -65,6 +66,7 @@ export const SsoUsersForm = () => { const enabledFromStore = useSelector(ssoUsersOnlySelector); const [enabled, setEnabled] = useState(enabledFromStore); const inputId = 'ssoUsersToggle'; + const { trackEvent } = useTracking(); useEffect(() => { dispatch(fetchAppInfoAction()); @@ -79,6 +81,7 @@ export const SsoUsersForm = () => { const handleToggle = async (value) => { setEnabled(value); + trackEvent(ADMIN_SERVER_SETTINGS_PAGE_EVENTS.toggleSsoUsers(value)); try { await fetch(URLS.instanceSettings(), { @@ -114,7 +117,6 @@ export const SsoUsersForm = () => { value={enabled} onChange={handleToggle} mobileDisabled - onChangeEventInfo={ADMIN_SERVER_SETTINGS_PAGE_EVENTS.SSO_USERS_SWITCHER} />