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

Unified Login: Track events for WPcom login flow #2843

Merged
merged 10 commits into from
Sep 14, 2020

Conversation

AmandaRiu
Copy link
Contributor

Closes #2721 by adding the final tracks events for the WPcom login flow. This includes:

  • Setting the flow to wordpress_com when the Continue with WordPress.com button is clicked.
  • Track events for google login
  • Persisting source and flow track state to AppPrefs so if the user closes the app on the store picker screen and returns later we can restore those two values.

Note: Track events for magic link and password were already added in a previous PR

Sample Track events

Flow: Wordpress.com + magic link

Tracked: unified_login_step, Properties: {"source":"default","flow":"prologue","step":"prologue"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"prologue","step":"prologue","click":"continue_with_wordpress_com"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"wordpress_com","step":"enter_email_address"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"wordpress_com","step":"start","click":"submit"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_magic_link","step":"start"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_magic_link","step":"start","click":"request_magic_link"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_magic_link","step":"magic_link_requested"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_magic_link","step":"email_opened"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_magic_link","step":"email_opened","click":"open_email_client"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_magic_link","step":"email_opened","click":"request_magic_link"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_magic_link","step":"magic_link_requested"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_magic_link","step":"email_opened"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_magic_link","step":"email_opened","click":"open_email_client"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_magic_link","step":"success"}

Flow: WordPress.com + password

Tracked: unified_login_step, Properties: {"source":"default","flow":"prologue","step":"prologue"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"prologue","step":"prologue","click":"continue_with_wordpress_com"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"wordpress_com","step":"enter_email_address"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"wordpress_com","step":"start","click":"submit"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_magic_link","step":"start"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_magic_link","step":"start","click":"login_with_password"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_password","step":"start"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_password","step":"start","click":"submit"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_password","step":"success"}

Flow: Google Login (2FA)

Tracked: unified_login_step, Properties: {"source":"default","flow":"prologue","step":"prologue"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"prologue","step":"prologue","click":"continue_with_wordpress_com"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"wordpress_com","step":"enter_email_address"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"google_login","step":"start"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"wordpress_com","step":"start","click":"submit_2fa_code"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"wordpress_com","step":"success"}

To Test

  • Test logging in with WordPress.com flow w/ magic link flow
  • Test logging in with WordPress.com flow w/ password flow
  • Test logging in with WordPress.com flow w/ google login
  • Test closing the app on the store picker screen and restoring the app. The source and flow should be reinstated and the success event tracked successfully. For example:
Tracked: unified_login_step, Properties: {"source":"default","flow":"wordpress_com","step":"success"}

Update release notes:

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@AmandaRiu AmandaRiu added Login category: tracks Related to analytics, including Tracks Events. labels Sep 14, 2020
@AmandaRiu AmandaRiu requested a review from a team September 14, 2020 00:03
@peril-woocommerce
Copy link

peril-woocommerce bot commented Sep 14, 2020

Fails
🚫

Danger failed to run /app/danger-0.sngnz6j2ui8.ts.

Messages
📖

This PR contains changes in the subtree libs/login/. It is your responsibility to ensure these changes are merged back into wordpress-mobile/WordPress-Login-Flow-Android. Follow these handy steps!
WARNING: Make sure your git version is 2.19.x or lower - there is currently a bug in later versions that will corrupt the subtree history!

  1. cd woocommerce-android
  2. git checkout issue/2721-tracks-2
  3. git subtree push --prefix=libs/login/ https://github.com/wordpress-mobile/WordPress-Login-Flow-Android.git merge/woocommerce-android/2843
  4. Browse to https://github.com/wordpress-mobile/WordPress-Login-Flow-Android/pull/new/merge/woocommerce-android/2843 and open a new PR.

Error TypeError

Cannot read property 'diff' of null
TypeError: Cannot read property 'diff' of null
    at checkCommitDiffs (/app/danger-0.sngnz6j2ui8.ts:43:49)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Dangerfile

38|         if (git === undefined) {
39|             console.log("About to crash due to an error")
40|             console.log("File:", thisFile)
41|             console.log("Danger Object: ", danger)
42| 
---------------------------------------------------^
43|             if (danger !== undefined) {
44|                 console.log("Danger is no longer defined")
45|             }
46|             else {

Generated by 🚫 dangerJS

@peril-woocommerce
Copy link

peril-woocommerce bot commented Sep 14, 2020

You can test the changes on this Pull Request by downloading the APK here.

@AmandaRiu AmandaRiu added this to the 5.1 milestone Sep 14, 2020
@nbradbury nbradbury self-assigned this Sep 14, 2020
mAnalyticsListener.trackFailure(message);
private void show2FaError(@Nullable String message) {
if (message != null) {
mAnalyticsListener.trackFailure(message);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we track the failure even if the message is null? No message will be logged, but a Stat.UNIFIED_LOGIN_FAILURE event will still occur, which we probably want to capture.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Normally, yes, but the way this is used in the login library is to clear the error on a text field, which means it occurs constantly while typing in a text field.

@nbradbury nbradbury self-requested a review September 14, 2020 17:29
@AmandaRiu
Copy link
Contributor Author

Thanks for the review @nbradbury! Addressed code comments and ready for another round 👍

Copy link
Contributor

@nbradbury nbradbury left a comment

Choose a reason for hiding this comment

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

:shipit:

@nbradbury nbradbury merged commit ef8daae into feature/unified-login Sep 14, 2020
@nbradbury nbradbury deleted the issue/2721-tracks-2 branch September 14, 2020 17:36
@AmandaRiu AmandaRiu mentioned this pull request Sep 15, 2020
1 task
@AmandaRiu AmandaRiu moved this from In progress to Done in Unified Login Sep 15, 2020
AmandaRiu added a commit that referenced this pull request Oct 29, 2020
0f54aa6 Merge pull request #46 from wordpress-mobile/merge/wcandroid-ul-m1
69cdd91 Fix merge conflicts
a955de5 Remove confusion over tag usage by renaming and fix social login bug
ff2b2cb Update to conform to changes from the Login Library
ac21a9e Merge commit '7fb87d9b60e417020e48bc33b89f4a3ffeb88a95' into issue/merge-login-lib-changes
c616393 Call login listener method for unregistered email if in WPcom login flow
895a4f5 Merge pull request #2930 from woocommerce/release/5.1
fc65d5c Merge pull request #2918 from woocommerce/issue/2911-tracks
cb75217 Merge pull request #2916 from woocommerce/issue/2897-overlap-ul
427d2e3 Add new methods for updating the step when resuming site creds screen
37998c4 Add new methods for updating the step when resuming magic link and site creds views
c4964cf Add new methods for updating the step when resuming site address and email password views
e87a28c Nest layout in a ScrollView so buttons no longer overlap on smaller screens
e58d872 Make screen scrollable for smaller displays and lower resolutions
5cf377a Allow login to complete if WPcom login without the woo-specific site address check
af41bb2 Null the site address view when the view is destroyed
9aefabe Resolved conflicts in login library build.gradle, pulled develop
c67f6fb Fix login flow memory leaks
695044d Merge pull request #2843 from woocommerce/issue/2721-tracks-2
f0302a7 Hide TOS buttons if not in signup mode during login
130b83f Updated gradle dependecy
3d99e1a Only log track failures if message is not null
a734985 Update button labels and add click events
946041b Add logic to route to login with wpcom creds flow
45f625d Style site creds login by magic link verification screen
f684c59 Handle magic link login
b4c8b8c Create alternative login email screen that provides site creds option
8d4ac00 Delete empty layouts created during merge and comment out usage
c9ace9d Merge commit 'b2b772d616c7d7e40c2b0d1c7d7a25e52ecbf59e' into issue/2655-unified-login-1
673ce5d Fix FluxC build
a069675 Update gradle plugin to 4.0 and gradle to 6.1.1
2fb113e Revert changes to gradle
a57069b Gradle updates.

git-subtree-dir: libs/login
git-subtree-split: 0f54aa6
@designsimply designsimply added feature: login Related to any part of the log in or sign in flow, or authentication. and removed Login labels May 6, 2021
AnirudhBhat pushed a commit that referenced this pull request Aug 11, 2021
Unified Login: Track events for WPcom login flow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: tracks Related to analytics, including Tracks Events. feature: login Related to any part of the log in or sign in flow, or authentication.
Projects
No open projects
Unified Login
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants