diff --git a/.env b/.env index 26cf7ac76d..33da6f0904 100644 --- a/.env +++ b/.env @@ -15,7 +15,7 @@ SEGMENT_KEY='' SITE_NAME=null INFO_EMAIL='' # ***** Cookies ***** -REGISTER_CONVERSION_COOKIE_NAME=null +USER_RETENTION_COOKIE_NAME=null # ***** Links ***** LOGIN_ISSUE_SUPPORT_LINK='' AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK=null diff --git a/.env.development b/.env.development index 065d345fe4..8bc4997fb1 100644 --- a/.env.development +++ b/.env.development @@ -20,7 +20,6 @@ SEGMENT_KEY='' SITE_NAME='Your Platform Name Here' INFO_EMAIL='info@example.com' # ***** Cookies ***** -REGISTER_CONVERSION_COOKIE_NAME='openedx-user-register-conversion' SESSION_COOKIE_DOMAIN='localhost' USER_INFO_COOKIE_NAME='edx-user-info' # ***** Links ***** diff --git a/.env.test b/.env.test index 52ceea6e17..a6546d69c6 100644 --- a/.env.test +++ b/.env.test @@ -16,6 +16,5 @@ ORDER_HISTORY_URL='http://localhost:1996/orders' REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh' SEGMENT_KEY='' SITE_NAME='Your Platform Name Here' -REGISTER_CONVERSION_COOKIE_NAME='openedx-user-register-conversion' APP_ID='' MFE_CONFIG_API_URL='' diff --git a/src/config/index.js b/src/config/index.js index 59fbe82fba..1524e23e66 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -1,7 +1,7 @@ const configuration = { // Cookies related configs SESSION_COOKIE_DOMAIN: process.env.SESSION_COOKIE_DOMAIN, - REGISTER_CONVERSION_COOKIE_NAME: process.env.REGISTER_CONVERSION_COOKIE_NAME || null, + USER_RETENTION_COOKIE_NAME: process.env.USER_RETENTION_COOKIE_NAME || 'authn-returning-user', // Features DISABLE_ENTERPRISE_LOGIN: process.env.DISABLE_ENTERPRISE_LOGIN || '', ENABLE_DYNAMIC_REGISTRATION_FIELDS: process.env.ENABLE_DYNAMIC_REGISTRATION_FIELDS || false, diff --git a/src/register/RegistrationPage.jsx b/src/register/RegistrationPage.jsx index 896f755152..a553fedd9f 100644 --- a/src/register/RegistrationPage.jsx +++ b/src/register/RegistrationPage.jsx @@ -172,26 +172,11 @@ const RegistrationPage = (props) => { useEffect(() => { if (registrationResult.success) { + // This event is used by GTM sendTrackEvent('edx.bi.user.account.registered.client', {}); - // Optimizely registration conversion event - window.optimizely = window.optimizely || []; - window.optimizely.push({ - type: 'event', - eventName: 'authn-registration-conversion', - }); - - // We probably don't need this cookie because this fires the same event as - // above for optimizely using GTM. - setCookie(getConfig().REGISTER_CONVERSION_COOKIE_NAME, true); // This is used by the "User Retention Rate Event" on GTM - setCookie('authn-returning-user'); - - // Fire GTM event used for integration with impact.com - window.dataLayer = window.dataLayer || []; - window.dataLayer.push({ - event: 'ImpactRegistrationEvent', - }); + setCookie(getConfig().USER_RETENTION_COOKIE_NAME, true); } }, [registrationResult]); diff --git a/src/register/RegistrationPage.test.jsx b/src/register/RegistrationPage.test.jsx index 5310f1623c..6bc2ce5a89 100644 --- a/src/register/RegistrationPage.test.jsx +++ b/src/register/RegistrationPage.test.jsx @@ -59,7 +59,7 @@ describe('RegistrationPage', () => { mergeConfig({ PRIVACY_POLICY: 'https://privacy-policy.com', TOS_AND_HONOR_CODE: 'https://tos-and-honot-code.com', - REGISTER_CONVERSION_COOKIE_NAME: process.env.REGISTER_CONVERSION_COOKIE_NAME, + USER_RETENTION_COOKIE_NAME: 'authn-returning-user', }); let props = {}; @@ -527,7 +527,7 @@ describe('RegistrationPage', () => { expect(registrationPage.find('input#password').length).toEqual(0); }); - it('should check registration conversion cookie', () => { + it('should check user retention cookie', () => { store = mockStore({ ...initialState, register: { @@ -539,7 +539,7 @@ describe('RegistrationPage', () => { }); renderer.create(routerWrapper(reduxWrapper())); - expect(document.cookie).toMatch(`${getConfig().REGISTER_CONVERSION_COOKIE_NAME}=true`); + expect(document.cookie).toMatch(`${getConfig().USER_RETENTION_COOKIE_NAME}=true`); }); it('should redirect to url returned in registration result after successful account creation', () => {