-
Notifications
You must be signed in to change notification settings - Fork 121
Native Jetpack Installation: Apply A/B test #8170
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
Native Jetpack Installation: Apply A/B test #8170
Conversation
You can test the changes from this Pull Request by:
|
jaclync
left a comment
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.
@selanthiraiyan I was testing the treatment case, but I couldn't get the variation after following the setup. The API request to set the assignment manually worked, as I saw the assignments with woocommerceios_login_jetpack_setup_flow: treatment initially for the anon ID. However, when logging in, the app calls ABTest.start(for:) again and that resets the assignments for the logged-in context. Were you able to get the treatment variation from your testing? Maybe we should consider this AB experiment in the logged-in context instead, since merchants can only install Jetpack after logging in?
I remember getting the treatment variation. I think I tested it incorrectly while raising my PR.
I started treating the experiment as logged-in, but so far I am not able to assign the "treatment" variation to my simulator's anonId (device ID). |
jaclync
left a comment
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.
I tested again with the logged-in paragraph in the assignments API FG linked in the PR description, and it worked for my a8c WPCOM account (somehow it didn't work using a bearer token for a non-a8c account). I verified that the assignments from the API have the treatment variation set for the Jetpack experiment. However, the variant in the app use case stays control because the assignments from the API weren't saved to UserDefaults since the ExPlat instance was deallocated.
After looking into the deallocation of ExPlat a bit, it looks like ExPlat.shared is overridden whenever ExPlat.configure is called. When launching the app in the logged-in state, it's called first with an anon ID and then again in the authenticated state which reset ExPlat.shared so the previous instance was deallocated. The assignments API call was made with the first ExPlat instance, so the assignments value couldn't be saved for access later.
I haven't looked into a solution yet, maybe we'll have to make sure the ABTest assignments API call is made only with the authenticated ExPlat? I also wonder if this might have caused the biased A/A test that we saw earlier pbxNRc-1QS-p2#comment-3819.
Experiments/Experiments/ABTest.swift
Outdated
| /// A/B test to measure the sign-in success rate when native Jetpack installation experience is enabled | ||
| /// Experiment ref: pbxNRc-29W-p2 | ||
| /// | ||
| case abTestNativeJetpackSetupFlow = "woocommerceios_login_jetpack_setup_flow" |
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.
nit: abTest might be redundant in the case name?
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.
WDYT @selanthiraiyan?
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.
Sorry, I missed this. Done in 2121554
|
Thank you, @jaclync for looking into the issue and sharing the observation! I'm trying to understand the problem here:
Does it mean you can get the treatment variation after Sharma sets the Jetpack experiment to logged-in?
From my understanding, the problem is not about deallocation because the assignments are saved to With that said, if we want to install Jetpack only in the authenticated state, Sharma's fix should fix the issue with the incorrect variant. I'm concerned if we want to support native Jetpack installation for site credential login in the next iteration - we'll need a new experiment for that then.
If my above understanding is correct, I think the fix for the crossovers is to reconfigure ExPlat again with anon ID when the user logs out of the app. This ensures the user gets the exact variation they saw before logging in. I encountered once that I got the different variant after logging out of the app, so doing that should fix the problem. WDYT? |
I got the Just a note that I tested this when launching the app in the logged-in state to repro the issue more easily, instead of launching the app in the logged-out state and then logging in as in the PR testing steps.
Other than the crossover issue, in pbxNRc-1QS-p2#comment-3819 (under @itsmeichigo were you able to get the |
I could not test it because I don't have access to sandbox - I'll have to request that soon. So we'll need your approval anyway 😅 |
…etpack installation happens after logging in.
3c903d5 to
198414f
Compare
jaclync
left a comment
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.
Works as expected now! 🎉 I can get the treatment variant consistently.
Out of the scope of this PR, I wonder if it's worth creating another 2 A/A tests for logged-out and logged-in states for the same release to see if it fixes the bias towards the control variant mentioned in pbxNRc-1QS-p2#comment-3819?
Experiments/Experiments/ABTest.swift
Outdated
| /// A/B test to measure the sign-in success rate when native Jetpack installation experience is enabled | ||
| /// Experiment ref: pbxNRc-29W-p2 | ||
| /// | ||
| case abTestNativeJetpackSetupFlow = "woocommerceios_login_jetpack_setup_flow" |
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.
WDYT @selanthiraiyan?
Closes: #8166
Description
This PR adds a new A/B test experiment for simplified login to enable native Jetpack installation flow. Experiment details:
Testing instructions
Prerequisite: Make sure that you have a test store that is not associated with your WP.com account or doesn't have Jetpack.
controlvariationTesting the
treatmentvariationWe will have to sandbox and assign a particular variation to the device to test the variations.
Prerequisites:
ifconfig) in the local matchine's/etc/hostsExPlatServiceL47 whereanon_idis set in the URL requestPATCH /wpcom/v2/experiments/0.1.0/assignmentswith the followingbodyand make sure it's successful:Screenshots
RELEASE-NOTES.txtif necessary.