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

Breach Results FxA Experiment (Growth Exp 3) #1659

Merged
merged 19 commits into from
May 7, 2020

Conversation

maxxcrawford
Copy link
Contributor

@maxxcrawford maxxcrawford commented Apr 23, 2020

Meta Issue: #1652

Steps to Verify:

Control

  1. Set treatment/control branch via URL param: https://monitor-v2.herokuapp.com/?experimentBranch=va
  2. Enter email address to be scanned: name@example.com
  3. On scan results page, the link directly below the headline should look like the following:

image


Treatment

  1. Set treatment/control branch via URL param: https://monitor-v2.herokuapp.com/?experimentBranch=vb
  2. Enter email address to be scanned: name@example.com
  3. On scan results page, the link directly below the headline should look like the following:

image

@maxxcrawford maxxcrawford force-pushed the 1652-breach-results-fxa-experiment branch from 869c1b5 to d388fec Compare April 23, 2020 22:30
@groovecoder groovecoder temporarily deployed to blurts-server-review April 23, 2020 22:30 Inactive
@lesleyjanenorton lesleyjanenorton temporarily deployed to blurts-server-review April 23, 2020 22:34 Inactive
@maxxcrawford maxxcrawford force-pushed the 1652-breach-results-fxa-experiment branch 2 times, most recently from 06e6bf6 to 8e30527 Compare May 6, 2020 00:11
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 May 6, 2020 00:14 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 May 6, 2020 00:39 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 May 6, 2020 00:41 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 May 6, 2020 03:03 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 May 6, 2020 03:55 Inactive
@maxxcrawford maxxcrawford marked this pull request as ready for review May 6, 2020 03:55
@maxxcrawford maxxcrawford requested review from groovecoder and lesleyjanenorton and removed request for groovecoder May 6, 2020 04:51
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 May 6, 2020 04:51 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 May 6, 2020 04:58 Inactive
@maxxcrawford maxxcrawford force-pushed the 1652-breach-results-fxa-experiment branch from a0d2f3b to 624f98a Compare May 6, 2020 05:00
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 May 6, 2020 05:00 Inactive
Comment on lines -20 to -32
let experimentBranch = null;
let isUserInExperiment = null;
let experimentBranchB = null;


if (EXPERIMENTS_ENABLED) {
const coinFlipNumber = Math.floor(Math.random() * 100);
experimentBranch = getExperimentBranch(req, coinFlipNumber);
// req.session.excludeFromExperiment is set to remember that the user has been excluded from the experiment.
if (!experimentBranch) { req.session.excludeFromExperiment = true; }
req.session.experimentBranch = experimentBranch;
isUserInExperiment = (experimentBranch === "vb");
experimentBranchB = (experimentBranch === "vb" && isUserInExperiment);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As the experiment doesn't split until the scans page, this has been removed.

@@ -230,6 +232,20 @@ async function getDashboard(req, res) {
const allBreaches = req.app.locals.breaches;
const { verifiedEmails, unverifiedEmails } = await getAllEmailsAndBreaches(user, allBreaches);

let experimentBranch = null;
let isUserInExperiment = null;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This adds the experiment branch/meta UTM info to the /user/dashboard page.

Comment on lines -43 to -57
// If we cannot parse req.headers["accept-language"], we should not
// enroll users in the experiment.
if (!req.headers || !req.headers["accept-language"]){
log.debug("No headers or accept-language information present.");
return false;
}

// If the user doesn't have an English variant langauge selected as their primary language,
// we do not enroll them in the experiment.
const lang = req.headers["accept-language"].split(",");
if (!lang[0].includes("en")) {
log.debug("Preferred language is not English variant: ", lang[0]);
return false;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because all the assets in this experiment are already localized, this experiment does not have any language qualifies during cohort assignment.

@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 May 6, 2020 20:29 Inactive

if (EXPERIMENTS_ENABLED) {
const coinFlipNumber = Math.floor(Math.random() * 100);
experimentBranch = getExperimentBranch(req, coinFlipNumber);
Copy link
Member

Choose a reason for hiding this comment

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

This looks like if someone never does a scan, but gets straight to their dashboard, they'll be put into an experiment?

@groovecoder
Copy link
Member

Spot-checked scan, sign-up, sign-in, and add additional emails. All work fine. Just the 1 question/comment about the experiment logic being in the dashboard, when the experiment only affects the scan results page.

@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 May 6, 2020 23:26 Inactive
@maxxcrawford
Copy link
Contributor Author

@groovecoder I updated the user controller per your request. Thanks!

@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 May 7, 2020 15:30 Inactive
@maxxcrawford maxxcrawford force-pushed the 1652-breach-results-fxa-experiment branch from 7eff601 to bf8a6e3 Compare May 7, 2020 16:16
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 May 7, 2020 16:16 Inactive
@maxxcrawford
Copy link
Contributor Author

Rebased. Merging after checks pass one final time.

@maxxcrawford maxxcrawford merged commit 7a879d7 into master May 7, 2020
@maxxcrawford maxxcrawford deleted the 1652-breach-results-fxa-experiment branch July 13, 2020 03:29
@maxxcrawford maxxcrawford added the growth-team Growth team label Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
growth-team Growth team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants