-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Application password login add analytic events #21886
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
Application password login add analytic events #21886
Conversation
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr21886-376b3ec | |
Commit | 376b3ec | |
Direct Download | jetpack-prototype-build-pr21886-376b3ec.apk |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr21886-376b3ec | |
Commit | 376b3ec | |
Direct Download | wordpress-prototype-build-pr21886-376b3ec.apk |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat/CMM-335-Offer-the-Application-Password-login-inside-a-card #21886 +/- ##
================================================================================================
Coverage 39.58% 39.58%
================================================================================================
Files 2130 2130
Lines 99558 99558
Branches 15350 15350
================================================================================================
Hits 39406 39406
Misses 56669 56669
Partials 3483 3483 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…e-a-card' into feat/CMM-334-Application-Password-login-add-analytic-events
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds analytics event tracking for successful Application Password logins, distinguishing between Jetpack and WordPress app flavors.
- Introduces two new
Stat
entries for application password login in the analytics tracker - Updates
ApplicationPasswordLoginHelper
to injectBuildConfigWrapper
and call a newtrackSuccessful
method on login success - Adjusts the unit test to supply the new
BuildConfigWrapper
dependency
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java | Added WP_ANDROID_APPLICATION_PASSWORD_LOGIN and JP_ANDROID_APPLICATION_PASSWORD_LOGIN enum entries |
WordPress/src/main/java/org/wordpress/android/ui/accounts/login/ApplicationPasswordLoginHelper.kt | Injected BuildConfigWrapper , implemented trackSuccessful to send analytics events |
WordPress/src/test/java/org/wordpress/android/ui/accounts/login/ApplicationPasswordLoginHelperTest.kt | Updated helper constructor in test to include BuildConfigWrapper |
Comments suppressed due to low confidence (2)
WordPress/src/test/java/org/wordpress/android/ui/accounts/login/ApplicationPasswordLoginHelperTest.kt:41
- Consider adding unit tests to verify that
AnalyticsTracker.track
is called with the correctStat
and properties when a login succeeds for both Jetpack and WordPress app flavors.
helper = ApplicationPasswordLoginHelper(testDispatcher(), siteSqlUtils, uriLoginWrapper, buildConfigWrapper)
WordPress/src/main/java/org/wordpress/android/ui/accounts/login/ApplicationPasswordLoginHelper.kt:15
- [nitpick] Consider renaming
URL_TAG
andSUCCESS_TAG
to more descriptive names likePROPERTY_URL
andPROPERTY_SUCCESS
to clarify their use as analytics property keys.
private const val URL_TAG = "url"
}, | ||
properties | ||
) | ||
Log.d("WP_RS", "Saved application password credentials for: $siteUrl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Extract the log tag "WP_RS"
into a constant (e.g., in a companion object) to avoid magic strings and ensure consistency across the class.
Log.d("WP_RS", "Saved application password credentials for: $siteUrl") | |
Log.d(LOG_TAG, "Saved application password credentials for: $siteUrl") |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adalpari I'm unable to test this due to the problem I reported in the previous PR, where I always see this in the log:
E WP_RS: Error during API discovery for https://nbradbury10.wordpress.com - FailureFindApiRoot
However, the logic here is sound so lets
661a58d
into
feat/CMM-335-Offer-the-Application-Password-login-inside-a-card
Description
This PR is adding a simple event to know about the successful Application Password login.
Testing instructions
Set the variable

ApplicationPasswordViewModelSlice.buildCard
to trueLog in with a self-hosted site
Open MySite screen, wait for the Application Password card to appear
Log in using the Application Password flow
jp_android_application_password_login
is sent (you can see it in logcat)