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

[Amplitude] Send Record on Teacher Login #50081

Merged
merged 4 commits into from
Feb 7, 2023
Merged

Conversation

epeach
Copy link

@epeach epeach commented Feb 4, 2023

Part of our Amplitude project.
Triggers when a teacher renders the homepage, but only once per session (to emulate the 'on login' experience).

Includes testing.

) {
trySetLocalStorage(LOGGED_TEACHER_SESSION, 'true');

analyticsReporter.sendEvent(EVENTS.TEACHER_LOGIN_EVENT, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgive my ignorance on local storage -- would this trigger correctly if a teacher logged in, logged out, and logged in again?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I meant for this to be trySetSESSIONStorage - fixing!

@@ -57,6 +60,13 @@ describe('StudentHomepage', () => {
});
});

it('does not log an Amplitude event for teacher signing-in', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should this test name be "does not log an Amplitude event for student signing-in"?

@epeach epeach requested a review from a team February 7, 2023 00:33
Copy link
Contributor

@bethanyaconnor bethanyaconnor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding tests!

@epeach epeach merged commit 0814a97 into staging Feb 7, 2023
@epeach epeach deleted the amplitude-teacher-login branch February 7, 2023 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants