Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add register intent prop for login segment call #34891

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion openedx/core/djangoapps/user_authn/views/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,15 @@ def _track_user_login(user, request):
'MailChimp': False
}
)
register_intent = request.POST.get('register_intent') == 'true'
segment.track(
user.id,
"edx.bi.user.account.authenticated",
{
'category': "conversion",
'label': request.POST.get('course_id'),
'provider': None
'provider': None,
'register_intent': register_intent,
},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,7 @@ class LoginSessionViewTest(ApiTestCase, OpenEdxEventsTestMixin):
USERNAME = "bob"
EMAIL = "[email protected]"
PASSWORD = "password"
REGISTER_INTENT = 'true'

@classmethod
def setUpClass(cls):
Expand Down Expand Up @@ -1117,6 +1118,7 @@ def test_login(self, include_analytics, mock_segment):
data = {
"email": self.EMAIL,
"password": self.PASSWORD,
"register_intent": self.REGISTER_INTENT,
}
if include_analytics:
track_label = "edX/DemoX/Fall"
Expand Down Expand Up @@ -1145,7 +1147,7 @@ def test_login(self, include_analytics, mock_segment):
mock_segment.track.assert_called_once_with(
expected_user_id,
'edx.bi.user.account.authenticated',
{'category': 'conversion', 'provider': None, 'label': track_label}
{'category': 'conversion', 'provider': None, 'label': track_label, 'register_intent': True}
)

def test_login_with_username(self):
Expand Down
Loading