From 1bb6c3ed0df5a78402554cbd1c603930eeb15fc2 Mon Sep 17 00:00:00 2001 From: Syed Sajjad Hussain Shah <52817156+syedsajjadkazmii@users.noreply.github.com> Date: Mon, 29 Aug 2022 09:54:51 +0500 Subject: [PATCH] fix: fire event only if the from_email property is true [VAN-1060] (#30904) --- common/djangoapps/track/views/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/track/views/__init__.py b/common/djangoapps/track/views/__init__.py index 65800a6f51..c5241b23fb 100644 --- a/common/djangoapps/track/views/__init__.py +++ b/common/djangoapps/track/views/__init__.py @@ -100,7 +100,12 @@ def user_track(request): # TODO: VAN-1052: This event is added to track the KPIs for A/B experiment. # Remove it after the experiment has been paused. - if name == 'edx.course.home.resume_course.clicked' and request.user: + if ( + name == 'edx.course.home.resume_course.clicked' and + data.get('from_email') and + data.get('event_type') == 'start' and + request.user + ): optimizely_client = OptimizelyClient.get_optimizely_client() if optimizely_client: optimizely_client.track('user_start_course_click', str(request.user.id))