fix: [VAN-1292] Remove personalized recommendation cookie
This commit is contained in:
committed by
leangseu-edx
parent
33c50082ef
commit
38b0d5832f
1
.env
1
.env
@@ -31,7 +31,6 @@ ENTERPRISE_MARKETING_UTM_SOURCE=''
|
||||
ENTERPRISE_MARKETING_UTM_CAMPAIGN=''
|
||||
ENTERPRISE_MARKETING_FOOTER_UTM_MEDIUM=''
|
||||
LEARNING_BASE_URL=''
|
||||
PERSONALIZED_RECOMMENDATION_COOKIE_NAME = 'edx-user-personalized-recommendation'
|
||||
ZENDESK_KEY=''
|
||||
HOTJAR_APP_ID=''
|
||||
HOTJAR_VERSION='6'
|
||||
|
||||
@@ -38,7 +38,6 @@ ENTERPRISE_MARKETING_UTM_CAMPAIGN='example.com Referral'
|
||||
ENTERPRISE_MARKETING_FOOTER_UTM_MEDIUM='Footer'
|
||||
LEARNING_BASE_URL='http://localhost:2000'
|
||||
SESSION_COOKIE_DOMAIN='localhost'
|
||||
PERSONALIZED_RECOMMENDATION_COOKIE_NAME = 'edx-user-personalized-recommendation'
|
||||
ZENDESK_KEY=''
|
||||
HOTJAR_APP_ID=''
|
||||
HOTJAR_VERSION='6'
|
||||
|
||||
@@ -10,7 +10,6 @@ const configuration = {
|
||||
SEGMENT_KEY: process.env.SEGMENT_KEY,
|
||||
// ACCESS_TOKEN_COOKIE_NAME: process.env.ACCESS_TOKEN_COOKIE_NAME,
|
||||
LEARNING_BASE_URL: process.env.LEARNING_BASE_URL,
|
||||
PERSONALIZED_RECOMMENDATION_COOKIE_NAME: process.env.PERSONALIZED_RECOMMENDATION_COOKIE_NAME || '',
|
||||
SESSION_COOKIE_DOMAIN: process.env.SESSION_COOKIE_DOMAIN || '',
|
||||
ZENDESK_KEY: process.env.ZENDESK_KEY,
|
||||
SUPPORT_URL: process.env.SUPPORT_URL || null,
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import { configuration } from 'config';
|
||||
import { setCookie, getCookie } from 'utils/cookies';
|
||||
|
||||
import track from '../track';
|
||||
import './index.scss';
|
||||
|
||||
@@ -8,22 +5,6 @@ export const useCourseCardData = (course, isControl) => {
|
||||
const handleCourseClick = (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const cookieName = configuration.PERSONALIZED_RECOMMENDATION_COOKIE_NAME;
|
||||
let recommendedCourses = getCookie(cookieName);
|
||||
if (typeof recommendedCourses === 'undefined') {
|
||||
recommendedCourses = { course_keys: [course.courseKey] };
|
||||
} else if (!recommendedCourses.course_keys.includes(course.courseKey)) {
|
||||
if (recommendedCourses.course_keys.length < 5) {
|
||||
recommendedCourses.course_keys.push(course.courseKey);
|
||||
} else {
|
||||
recommendedCourses.course_keys.shift();
|
||||
recommendedCourses.course_keys.push(course.courseKey);
|
||||
}
|
||||
}
|
||||
recommendedCourses.is_control = isControl;
|
||||
recommendedCourses.is_personalized_recommendation = isControl;
|
||||
setCookie(cookieName, JSON.stringify(recommendedCourses), 365);
|
||||
|
||||
track.recommendedCourseClicked(
|
||||
course.courseKey,
|
||||
isControl,
|
||||
|
||||
Reference in New Issue
Block a user