feat: send page event for welcome page (#328)

Also, added a new optimizely event to capture total registrations.
This commit is contained in:
Waheed Ahmed
2021-06-09 14:33:58 +05:00
committed by GitHub
parent a656fc40ac
commit 942b91d9ce
2 changed files with 10 additions and 2 deletions

View File

@@ -446,9 +446,15 @@ class RegistrationPage extends React.Component {
if (this.props.registrationResult.success) {
setSurveyCookie('register');
// Fire optimizely event
window.optimizely = window.optimizely || [];
// Fire optimizely events
window.optimizely.push({
type: 'event',
eventName: 'van_504_total_registrations',
});
if (this.state.optimizelyExperimentName !== 'progressive_profiling_phase1') {
window.optimizely = window.optimizely || [];
window.optimizely.push({
type: 'event',
eventName: 'van_504_conversion_rate',

View File

@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { Helmet } from 'react-helmet';
import { getConfig } from '@edx/frontend-platform';
import { sendPageEvent } from '@edx/frontend-platform/analytics';
import {
ensureAuthenticatedUser, hydrateAuthenticatedUser, getAuthenticatedUser,
} from '@edx/frontend-platform/auth';
@@ -35,6 +36,7 @@ const WelcomePage = (props) => {
if (props.location.state && props.location.state.registrationResult) {
setRegistrationResult(props.location.state.registrationResult);
sendPageEvent('login_and_registration', 'welcome');
}
}, []);