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 event login step fixes #2918

Merged
merged 4 commits into from
Sep 25, 2020
Merged

Conversation

AmandaRiu
Copy link
Contributor

This PR fixes an issue where previously if the user clicked on the "Help" icon on any of the login views (not the epilogue screen - that will be a different PR), the Step would continue to be set to help erroneously even after the user returned to the regular login screen. For example:

On the site address screen the unified event string would normally look like then when you click Continue:

{"source":"default","flow":"login_site_address","step":"start","click":"submit"}

But, if you click "help" while on this screen, then click back to return to the site address screen and then click Continue, the event looks like this:

{"source":"default","flow":"login_site_address","step":"help","click":"submit"}

To fix this I've added some additional login listeners for setting the appropriate step when that view resumes:

  • emailPasswordFormScreenResumed()
  • siteAddressFormScreenResumed()
  • magicLinkRequestScreenResumed()
  • fun magicLinkSentScreenResumed()
  • usernamePasswordScreenResumed()

This cleans up the track event flow and makes it more accurate. Below are snippets from various scenarios. Notice how the Help button is clicked between screens to ensure the Step is accurately reset when resumed.

Login by Site Address

Tracked: unified_login_step, Properties: {"source":"default","flow":"prologue","step":"prologue"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"prologue","step":"prologue","click":"login_with_site_address"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_site_address","step":"start"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_site_address","step":"start","click":"show_help"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_site_address","step":"help"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_site_address","step":"start","click":"submit"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_site_address","step":"enter_email_address"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_site_address","step":"enter_email_address","click":"show_help"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_site_address","step":"help"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_site_address","step":"enter_email_address","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":"show_help"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_password","step":"help"}
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"}

Site Credentials Screen

Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_site_address","step":"enter_email_address","click":"login_with_site_creds"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_store_creds","step":"username_password"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_store_creds","step":"username_password","click":"show_help"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_store_creds","step":"help"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"login_store_creds","step":"username_password","click":"submit"}

Login 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":"enter_email_address","click":"show_help"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"wordpress_com","step":"help"}
Tracked: unified_login_interaction, Properties: {"source":"default","flow":"wordpress_com","step":"enter_email_address","click":"submit"}
Tracked: unified_login_step, Properties: {"source":"default","flow":"login_magic_link","step":"start"}

To Test

Verify clicking the toolbar help button and then clicking back sends the correct track event on the following screens:

Site Address Login Flow

  • Site address screen
  • email screen
  • site credentials screen
  • magic link screens (requested and sent)

**WordPress.com

  • email screen
  • magic link screens

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 25, 2020
@AmandaRiu AmandaRiu added this to the 5.1 ❄️ milestone Sep 25, 2020
@AmandaRiu AmandaRiu requested a review from a team September 25, 2020 00:17
@peril-woocommerce
Copy link

peril-woocommerce bot commented Sep 25, 2020

Fails
🚫

Danger failed to run /app/danger-0.kfwmv0p60eq.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/2911-tracks
  3. git subtree push --prefix=libs/login/ https://github.com/wordpress-mobile/WordPress-Login-Flow-Android.git merge/woocommerce-android/2918
  4. Browse to https://github.com/wordpress-mobile/WordPress-Login-Flow-Android/pull/new/merge/woocommerce-android/2918 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.kfwmv0p60eq.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

@AmandaRiu AmandaRiu changed the title unified login: Track event login step fixes Unified login: Track event login step fixes Sep 25, 2020
@peril-woocommerce
Copy link

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

@anitaa1990 anitaa1990 self-assigned this Sep 25, 2020
Copy link
Contributor

@anitaa1990 anitaa1990 left a comment

Choose a reason for hiding this comment

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

Verified all tracking events are sent correctly after clicking on Help and resuming the login flow! Nice work :shipit:

@anitaa1990 anitaa1990 merged commit a4e9c87 into release/5.1 Sep 25, 2020
@anitaa1990 anitaa1990 deleted the issue/2911-tracks branch September 25, 2020 09:00
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 event login step fixes
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
  
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

3 participants