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

GH-2071/Hub-promo-abc-test #583

Merged
merged 9 commits into from Jul 20, 2020

Display plain home view, home view with Premium modal, or new Upgrade…

… Plan view in Hub depending on A/B/C/ test bucket
  • Loading branch information
wlycdgr committed Jul 20, 2020
commit 75508b3b2226693e09081eb963885c654b683e61
@@ -119,9 +119,9 @@ class HomeViewContainer extends Component {
} = home;

// Flag to display promo modal (used in A/B testing)
const shouldShowPromoModal = false;
const { pm } = QueryString.parse(window.location.search);
// Logic to display premium modal if it is the case that it is being shown once per hub refresh to non-premium users
const showPromoModal = shouldShowPromoModal && !premium_promo_modal_shown && !isPremium;
const showPromoModal = pm && pm === 'true' && !premium_promo_modal_shown && !isPremium;

return (
<div className="full-height">
@@ -1099,8 +1099,6 @@ function setupHubPromoABTest() {
} else {
conf.hub_promo_variant = 'upgrade';
}

console.error(`conf.hub_promo_version in setupHubPromoABTest: ${conf.hub_promo_variant}`);
}

/**
@@ -1737,13 +1735,14 @@ function initializeGhosteryModules() {
]).then(() => {
// run scheduledTasks on init
scheduledTasks().then(() => {
console.error('In scheduledTasks .then callback');
// open the Ghostery Hub on install with justInstalled query parameter set to true
// we need to do this after running scheduledTasks for the first time
// because of an A/B test that determines which promo variant is shown in the Hub on install
if (globals.JUST_INSTALLED) {
const route = (conf.hub_promo_variant === 'upgrade' || conf.hub_promo_variant === 'not_yet_set') ? '' : '#home';
const showPremiumPromoModal = conf.hub_promo_variant === 'midnight';
chrome.tabs.create({
url: chrome.runtime.getURL(`./app/templates/hub.html?justInstalled=true&promoVariant=${conf.hub_promo_variant}`),
url: chrome.runtime.getURL(`./app/templates/hub.html?$justInstalled=true&pm=${showPremiumPromoModal}${route}`),
active: true
});
}
ProTip! Use n and p to navigate between commits in a pull request.