fix: A/B test marketing opt-in (#448)
fire optimizely event to record opt-in/out for marketing emails VAN-738
This commit is contained in:
@@ -523,6 +523,13 @@ class RegistrationPage extends React.Component {
|
||||
value: this.state.totalRegistrationTime,
|
||||
},
|
||||
});
|
||||
|
||||
if (getConfig().MARKETING_EMAILS_OPT_IN === 'true' && this.state.optimizelyExperimentName === 'marketing_opt_in') {
|
||||
window.optimizely.push({
|
||||
type: 'event',
|
||||
eventName: `marketing-emails-opt-${this.state.marketingOptIn === true ? 'in' : 'out'}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { call, put, takeEvery } from 'redux-saga/effects';
|
||||
|
||||
import { camelCaseObject, getConfig } from '@edx/frontend-platform';
|
||||
import { camelCaseObject } from '@edx/frontend-platform';
|
||||
import { logError, logInfo } from '@edx/frontend-platform/logging';
|
||||
|
||||
// Actions
|
||||
@@ -24,14 +24,6 @@ export function* handleNewUserRegistration(action) {
|
||||
yield put(registerNewUserBegin());
|
||||
|
||||
const { redirectUrl, success } = yield call(registerRequest, action.payload.registrationInfo);
|
||||
const { experimentName } = window;
|
||||
if (getConfig().MARKETING_EMAILS_OPT_IN === 'true'
|
||||
&& success && experimentName && experimentName === 'marketing_opt_in') {
|
||||
window.optimizely.push({
|
||||
type: 'event',
|
||||
eventName: `marketing-emails-opt-${action.payload.registrationInfo.opt === true ? 'in' : 'out'}`,
|
||||
});
|
||||
}
|
||||
yield put(registerNewUserSuccess(
|
||||
redirectUrl,
|
||||
success,
|
||||
|
||||
@@ -34,7 +34,7 @@ const messages = defineMessages({
|
||||
},
|
||||
'registration.opt.in.label': {
|
||||
id: 'registration.opt.in.label',
|
||||
defaultMessage: 'You will be receive marketing emails by checking it',
|
||||
defaultMessage: 'Receive marketing emails',
|
||||
description: 'You will be receive marketing emails by checking it',
|
||||
},
|
||||
// Help text
|
||||
|
||||
Reference in New Issue
Block a user