diff --git a/src/data/thunks.js b/src/data/thunks.js index 08cc25fa..b63d466a 100644 --- a/src/data/thunks.js +++ b/src/data/thunks.js @@ -1,7 +1,7 @@ import { sendTrackEvent } from '@edx/frontend-platform/analytics'; import { getAuthenticatedUser } from '@edx/frontend-platform/auth'; -import { trackChatBotMessageOptimizely } from '../utils/optimizelyExperiment'; +import trackChatBotMessageOptimizely from '../utils/optimizelyExperiment'; import fetchChatResponse, { fetchLearningAssistantEnabled } from './api'; import { setCurrentMessage, @@ -60,7 +60,7 @@ export function getChatResponse(courseId, unitId, promptExperimentVariationKey = dispatch(setApiIsLoading(true)); try { if (promptExperimentVariationKey) { - trackChatBotMessageOptimizely(userId); + trackChatBotMessageOptimizely(userId.toString()); } const customQueryParams = promptExperimentVariationKey ? { responseVariation: promptExperimentVariationKey } : {}; const message = await fetchChatResponse(courseId, messageList, unitId, customQueryParams); diff --git a/src/utils/optimizelyExperiment.js b/src/utils/optimizelyExperiment.js index e792aef0..68762b09 100644 --- a/src/utils/optimizelyExperiment.js +++ b/src/utils/optimizelyExperiment.js @@ -1,16 +1,8 @@ import { getOptimizely } from '../data/optimizely'; -const trackChatBotLaunchOptimizely = (userId, userAttributes = {}) => { - const optimizelyInstance = getOptimizely(); - optimizelyInstance.track('learning_assistant_chat_click', userId, userAttributes); -}; - const trackChatBotMessageOptimizely = (userId, userAttributes = {}) => { const optimizelyInstance = getOptimizely(); optimizelyInstance.track('learning_assistant_chat_message', userId, userAttributes); }; -export { - trackChatBotLaunchOptimizely, - trackChatBotMessageOptimizely, -}; +export default trackChatBotMessageOptimizely;