Skip to content

MBL-2952: Telemetry + small improvements on Login flow + analytics adjustments#2467

Merged
Arkariang merged 8 commits intomasterfrom
imartin/MBL-2952-login-telemetry
Feb 2, 2026
Merged

MBL-2952: Telemetry + small improvements on Login flow + analytics adjustments#2467
Arkariang merged 8 commits intomasterfrom
imartin/MBL-2952-login-telemetry

Conversation

@Arkariang
Copy link
Copy Markdown
Contributor

@Arkariang Arkariang commented Jan 26, 2026

📲 What

  • Scenario 1: redirection processing on OnCreate.
    📥 Despite not being able to reproduce at all this scenario, by looking at the documentation there is the small chance the 'LoginToutActivity' was killed by the OS. Even if we use android:launchMode="singleTop", if the system killed the Activity to reclaim memory while the user was in the ChromeTab, the redirect will recreate 'LoginToutActivity' from scratch, triggering onCreate instead of onNewInten`. This specific scenario will look like a loop to the user.

  • Scenario 2: Added on OAuthWebview systemBarsPadding + some extra flags for javascript + dom storage.
    Another piece tried/tested was eliminating Google Chrome completely, therefore no ChromeTab involved. In this scenarios a WebView (in OAuthWebViewActivity) will handle the login flow. Users triggering this scenario will be those user using browser not Chromium based (Mozilla Firefox, Opera mini, Tor ...). This was tested once more successfully but adjusted the UI to respect systemBars + allowed the webview some more capabilities for javascript and dome based storage just to play it safe, we have tried this route several times being able to log in successfully but cannot try every single browser out there.

  • **Telemetry: Added on OAuthViewModel redundant try/catch blokes + sending any potential error to Firebase as Non-fatal.
    attached imaged of how it will look like in Firabase:

Screenshot 2026-01-26 at 3 37 50 PM
  • Analytics analysis + added one misplaced CTA button clicked
    Some additional information about analytic events. On android we had misplaced a CTA button clicked (it was only trigged when user successfully logged in).

Now the sequence of Analytic events triggered are

1 - PageViewed with "context_page": "log_in_sign_up" , triggered when LoginToutActivity is presented.

2 - CTA Clicked with "context_cta": "log_in_initiate" , triggered when user presses login button this button opens the web experience (in a ChromeTab/Webview). (This is the one originally misplaced)

3- When ChromeTab is triggered & 4 - When user is redirected back to KSApp.

5- Identify call when user successfully logged in

Steps

📥 Note additionally every single one of those analytic events is marked with a trait anonymousId before and after the user logs in. This specific information should me helpful when putting together funnels

"traits": {
"anonymousId": "11aec7dc-d038-419e-95e4-7db9c25e8ec6"
},

Step5-AnnonimousId step4-anonymousId Step1-anonymousId

🤔 Why

We have been having user reviews complaining about several issues with login, in both platforms iOS + Android, as we have been completely unable to reproduce in any platform adding more telemetry. Same approach has been taken on the backend side -> https://github.com/kickstarter/kickstarter/pull/33354 which results once Pr released will be displayed in https://app.datadoghq.com/dashboard/2xu-k3f-zki/kickstarter---logins?fromUser=false&offset=1&refresh_mode=yearly&from_ts=1737934143888&to_ts=1769470143887&live=true.
In case more information is required pass by https://kickstarter.slack.com/archives/C0A723PENDT

| | |

📋 QA

To test Scenario 1:

    • Log in as you normally do and check everything keeps working fine (OnNewIntent route)
    • to force the OnCreate route comment out in the manifest line 135
Screenshot 2026-01-26 at 3 43 43 PM

To test Scenario 2:

  • Eliminate Chrome from you device (or disable it), and try to log in, OAuthWebViewActivity with a webview is presented instead of a ChromeTab.

To test analytics:

  • Make sure you agreed to consent management (other wise install again the app), and check segment dashboard to see the sequence of events

Story 📖

MBL-2952

- Added re-direction processing on OnCreate
- Added on OAuthWebview systemBarsPadding + some extra flags just in case
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 27, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 80.95238% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.91%. Comparing base (68feeb1) to head (aef913e).

Files with missing lines Patch % Lines
.../java/com/kickstarter/viewmodels/OAuthViewModel.kt 80.95% 8 Missing and 4 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2467      +/-   ##
============================================
- Coverage     64.92%   64.91%   -0.01%     
- Complexity     2411     2413       +2     
============================================
  Files           380      380              
  Lines         28964    28977      +13     
  Branches       4170     4171       +1     
============================================
+ Hits          18804    18811       +7     
- Misses         7887     7894       +7     
+ Partials       2273     2272       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Arkariang Arkariang marked this pull request as ready for review January 27, 2026 03:51
codeVerifier = null
}
}
} catch (e: OAuthException) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we want to only catch OAuthException here and below? Seems like processThrowable() would call errorAction to wrap any exception in an OAuthException and send it to Firebase.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My bad, this should not have been comited/pushed, was forcing around Firebase reporting capabilities 🤦‍♀️

@Arkariang Arkariang changed the title MBL-2952: Telemetry + small improvements on Login flow MBL-2952: Telemetry + small improvements on Login flow + analytcs Jan 29, 2026

oAuthViewModel.provideErrorAction { cause ->
FirebaseCrashlytics.getInstance().recordException(OAuthException(cause))
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OAuthExceptio only purpose is to unify reports on Firebase (aiming to single source non-fatal report), using it to wrap all Throwable errors that might happen

@Arkariang Arkariang changed the title MBL-2952: Telemetry + small improvements on Login flow + analytcs MBL-2952: Telemetry + small improvements on Login flow + analytics adjustments Jan 29, 2026
Copy link
Copy Markdown
Contributor

@tonyteate tonyteate left a comment

Choose a reason for hiding this comment

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

LGTM!

Image

@Arkariang Arkariang merged commit 62218bb into master Feb 2, 2026
3 checks passed
@Arkariang Arkariang deleted the imartin/MBL-2952-login-telemetry branch February 2, 2026 17:07
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.

3 participants