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

Growth Experiment #5 - "Join the Party" Share Link #1797

Merged
merged 26 commits into from
Aug 17, 2020

Conversation

maxxcrawford
Copy link
Contributor

@maxxcrawford maxxcrawford commented Jul 23, 2020

Related issues:

Outstanding issues:

  • Add GA events for all interactions
  • Set custom UTM params on traffic that comes from the share links
  • Add documentation for -exp SemVer tagging

Testing Steps

There are four share elements that show up in the treatment branch. Below describes the steps to test each:

Requirements:

  • The first language needs to be an English variant.

General / Footer

  1. Enroll in the treatment branch: https://monitor-v2.herokuapp.com/?experimentBranch=vb
  2. Scroll to the bottom of any page and click "Share Monitor" in the Footer

image

  1. A modal should appear with the link: /share/purple

image

  1. This URL should redirect the user back to the homepage.

General / Avatar Menu (Must be logged in)

  1. Enroll in the treatment branch: https://monitor-v2.herokuapp.com/?experimentBranch=vb
  2. Sign into Monitor
  3. Once signed in, the avatar menu will be visible in the top right corner, where the Sign In button was. Click it, and then click on "Share Monitor"

image

  1. It'll open the same modal, except with the link /share/orange
  2. This URL should redirect the user back to the homepage. (Note - if you're logged in, it'll redirect you to the /user/dashboard.)

General / User Dashboard (Must be logged in)

  1. Enroll in the treatment branch: https://monitor-v2.herokuapp.com/?experimentBranch=vb
  2. Sign into Monitor
  3. Once signed in, scroll down below the first email address/set of breaches on the dashboard page. Click the following link:

image

  1. It'll open the same modal, except with the link /share/blue
  2. This URL should redirect the user back to the homepage. (Note - if you're logged in, it'll redirect you to the /user/dashboard.)

Breach-specific / Breach Details Page

  1. Enroll in the treatment branch: https://monitor-v2.herokuapp.com/?experimentBranch=vb
  2. Go to a breach detail page (Example: https://monitor-v2.herokuapp.com/breach-details/Wattpad)
  3. Click on the following link:

image

  1. It'll open the same modal, except with the link will include the name of the current breach. /share/Wattpad. Note that it will also have different text in the first paragraph too!
  2. This URL will redirect back to the homepage, but should have that breach set as the featured breach.

Expected behavior about the Modal:

  • Once open, click anywhere out of the modal to dismiss it
  • Once open, click the "X" to dismiss it
  • Once open, click the Escape ("ESC") key to dismiss it
  • If you focus/click into the input box, it should highlight the URL
  • Clicking the "Copy" button will copy the URL to the clip board
  • It has been sized for both mobile and desktop.

@maxxcrawford maxxcrawford added the growth-team Growth team label Jul 23, 2020
@maxxcrawford maxxcrawford changed the title Growth Experiment #5 - Join the Party Share Link Growth Experiment #5 - "Join the Party" Share Link Jul 23, 2020
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 24, 2020 06:53 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 24, 2020 06:53 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 24, 2020 07:00 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 24, 2020 07:31 Inactive
@@ -36,9 +36,10 @@
<h2 class="pref-headline">{{ getString "email-addresses-title" }}</h2>
{{> dashboards/manage-email-link variableClass="hide-mobile"}}
</div>
<div class="email-cards flx flx-col jst-cntr">
<div class="email-cards flx flx-col jst-cntr {{#if experimentFlags.treatmentBranch}}experiment{{/if}}">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note - I wasn't able / didn't see the value in persisting the experimentFlags data all the way down to each verifiedEmail object. This solution still prints it out, but it is hidden (via CSS) by default.

@lesleyjanenorton lesleyjanenorton temporarily deployed to monitor-v2 July 27, 2020 22:16 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 28, 2020 00:46 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 28, 2020 15:12 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 28, 2020 15:20 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 28, 2020 15:51 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 28, 2020 16:09 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 28, 2020 18:12 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 29, 2020 12:43 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 29, 2020 19:31 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 29, 2020 20:08 Inactive
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 30, 2020 13:42 Inactive
@maxxcrawford maxxcrawford force-pushed the 1789-join-the-party-experiment branch from b83272e to b3c0a22 Compare July 30, 2020 15:26
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 July 30, 2020 15:26 Inactive
@maxxcrawford maxxcrawford marked this pull request as ready for review July 30, 2020 15:29
const { changePWLinks } = require("../lib/changePWLinks");
const { getAllEmailsAndBreaches } = require("./user");

const EXPERIMENTS_ENABLED = (AppConstants.EXPERIMENT_ACTIVE === "1");
const { getExperimentFlags } = require("./utils");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding experiment flags to the breach details template to show/hide the Share CTA in page.

Comment on lines +38 to +41
if (req.session.redirectHome) {
req.session.redirectHome = false;
return res.redirect("/");
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before this flag, if a user went to /share/{non-breach-identifier}, it would leave that as the URL. This puts them back to the homepage, proper like.

Note that if you share a breach detail link (Ex: share/Zynga), it keeps the /share/ pattern.

Comment on lines +49 to +53
getExperimentBranch(req, false, ["en"], {
"va": 50,
"vb": 50,
});
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Enroll 50% of ALL English variant traffic in this experiment.

Copy link
Member

Choose a reason for hiding this comment

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

This function returns assignedCohort but we're not assigning that to anything here? If this function is mainly to set the experiment for the session, the function should probably be re-named to setExperimentBranch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed Issue #1884

@@ -229,7 +229,9 @@ async function getDashboard(req, res) {
const user = req.user;
const allBreaches = req.app.locals.breaches;
const { verifiedEmails, unverifiedEmails } = await getAllEmailsAndBreaches(user, allBreaches);
const utmOverrides = getUTMContents(req);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting the /share/ link catcher on this page too, in case the person who uses it is already signed into Monitor.

middleware.js Outdated
const featuredBreach = HIBP.getBreachByName(allBreaches, breachName);

if (featuredBreach) {
req.session.utmOverrides.campaignTerm = featuredBreach.Name;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verify that user is actually requesting a valid Breach to be featured.


const router = express.Router();
const csrfProtection = csrf();

router.get("/", csrfProtection, home);
router.get("/share/orange", csrfProtection, getShareUTMs, home);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added middleware function to catch /share/ link requests and set the UTMs accordingly

@@ -28,6 +33,21 @@ function getFooterLinks(args) {
},
];

// Growth Experiment: Only add the footer share line if user is on VB branch
const experimentFlags = getExperimentFlags(args.data.root.req, EXPERIMENTS_ENABLED);
if (EXPERIMENTS_ENABLED && experimentFlags.treatmentBranch) {
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 appends the share link to the footer (same in the header too) without breaking the current loop-build flow to hard-code this entry in.

string.stringId =LocaleUtils.fluentFormat(locales, stringId);
// Growth Experiment: Catch EN* Experimnal Strings
if (stringId === "share-monitor") {
string.stringId = "Share Monitor";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Work-around to not have the L10N team localize this experiment string.

…riment. This will keep the share-traffic cohort sepereate from the experiment cohort.
Fixed #1829 - Increase size of modal headline to match comp
Fixed #1839 - Revised max-width of input/btn area to match comp
Fixed #1826 - Revised paragraph to be left-aligned (while still centered)
…match the comp

Fixed #1856 - Adjusted modal headline size on modal to better match the comp
Adjusted nbsp/word wrapping issue
- Fixed indentation
- Corrected comment typos
- Removed unneeded whitespace
- Changed order of require statements
@maxxcrawford maxxcrawford temporarily deployed to monitor-v2 August 17, 2020 15:58 Inactive
@maxxcrawford maxxcrawford merged commit 978d4e1 into master Aug 17, 2020
@maxxcrawford maxxcrawford moved this from In progress to Done in Growth Experiment #5 - Join the Party Aug 18, 2020
maxxcrawford added a commit that referenced this pull request Aug 26, 2020
…eriment"

This reverts commit 978d4e1, reversing
changes made to 929381c.
maxxcrawford added a commit that referenced this pull request Aug 26, 2020
…eriment"

This reverts commit 978d4e1, reversing
changes made to 929381c.
@groovecoder groovecoder deleted the 1789-join-the-party-experiment branch September 25, 2020 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
growth-team Growth team
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants