diff --git a/src/forgot-password/ForgotPasswordPage.jsx b/src/forgot-password/ForgotPasswordPage.jsx index ff38134015..f4c7b31454 100644 --- a/src/forgot-password/ForgotPasswordPage.jsx +++ b/src/forgot-password/ForgotPasswordPage.jsx @@ -41,7 +41,7 @@ const ForgotPasswordPage = (props) => { const navigate = useNavigate(); useEffect(() => { - sendPageEvent('login_and_registration', 'reset'); + sendPageEvent('login_and_registration', 'forgot-password'); sendTrackEvent('edx.bi.password_reset_form.viewed', { category: 'user-engagement' }); }, []); diff --git a/src/reset-password/ResetPasswordPage.jsx b/src/reset-password/ResetPasswordPage.jsx index 9b4b67588c..0393d27956 100644 --- a/src/reset-password/ResetPasswordPage.jsx +++ b/src/reset-password/ResetPasswordPage.jsx @@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; import { getConfig } from '@edx/frontend-platform'; +import { sendPageEvent } from '@edx/frontend-platform/analytics'; import { useIntl } from '@edx/frontend-platform/i18n'; import { Form, @@ -42,6 +43,10 @@ const ResetPasswordPage = (props) => { const { token } = useParams(); const navigate = useNavigate(); + useEffect(() => { + sendPageEvent('login_and_registration', 'reset-password'); + }, []); + useEffect(() => { if (props.status !== TOKEN_STATE.PENDING && props.status !== PASSWORD_RESET_ERROR) { setErrorCode(props.status); diff --git a/src/reset-password/tests/ResetPasswordPage.test.jsx b/src/reset-password/tests/ResetPasswordPage.test.jsx index 421edc9e9b..0c9ba1a226 100644 --- a/src/reset-password/tests/ResetPasswordPage.test.jsx +++ b/src/reset-password/tests/ResetPasswordPage.test.jsx @@ -19,6 +19,10 @@ import ResetPasswordPage from '../ResetPasswordPage'; const mockedNavigator = jest.fn(); const token = '1c-bmjdkc-5e60e084cf8113048ca7'; +jest.mock('@edx/frontend-platform/analytics', () => ({ + sendPageEvent: jest.fn(), +})); + jest.mock('@edx/frontend-platform/auth'); jest.mock('react-router-dom', () => ({ ...(jest.requireActual('react-router-dom')),