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-2097 bugfix: make sure alternate view displays when expected #618

Closed
wants to merge 35 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7a1ca55
bump browser core
christophertino Jul 31, 2020
4b3e192
Updated Firefox Android extension (#587)
christophertino Aug 10, 2020
a95835f
Added a product_id parameter (#574)
hankyje Aug 10, 2020
e3f9ff8
Display error message when locked out (#577)
afranco07 Aug 10, 2020
c161eca
udpated changelog
christophertino Aug 10, 2020
04c121a
update package dependencies
christophertino Aug 11, 2020
7e0a3c2
GH-2086, GH-2084, GH-2040: Update intro hub Get Plus, Midnight & Insi…
benstrumeyer Aug 14, 2020
124d633
GH-2035: Update In-App Plus/Premium pricing (#596)
benstrumeyer Aug 17, 2020
c1f3beb
Remove obsolete @cliqz/adblocker-circumvention dependency (#598)
remusao Aug 17, 2020
efccf8c
Fix bug where content overflows past the specified panel height in ru…
benstrumeyer Aug 25, 2020
fde426c
Shorten uninstall url by shorterning subscription_interval param name…
wlycdgr Aug 25, 2020
1719bc7
bump browser core
christophertino Sep 8, 2020
8c3c62b
update CODEOWNERS
christophertino Sep 11, 2020
0769c49
bump browser core
christophertino Sep 13, 2020
387f037
Return early from setupHubPromoABTest if A/B tests have not yet been …
wlycdgr Sep 21, 2020
bdf6206
Detect Ghostery Desktop browser (#602)
sammacbeth Sep 21, 2020
30a0d04
GH-2171: Add Missing Page Title to Upgrade Plan Hub Page (#604)
fcjr Sep 21, 2020
34c6223
GH-2168: Change hub logo link (#605)
leuryr Sep 21, 2020
27e21c1
update readme
christophertino Sep 21, 2020
4e0560b
prune dead links from readme
christophertino Sep 21, 2020
f1c8941
GH-2100, GH-2097: Onboarding test 2 (#603)
leuryr Sep 22, 2020
0781353
Feature/console debugging (#568)
IAmThePan Sep 24, 2020
e4b0a0b
ignore purplebox creation and updates on Android
christophertino Sep 24, 2020
443ca8a
fixing bug in debugger openPanel
christophertino Sep 24, 2020
7f975d1
GH-2159: Update frequency reduction, AB test opt-out, remove Cliqz AB…
wlycdgr Sep 24, 2020
653b7d4
GH-2105: Sync button hover states in the hub (#607)
benstrumeyer Sep 25, 2020
52f1a50
GH-2158: Subscription_type ping parameter not sending on login (#606)
benstrumeyer Sep 28, 2020
73318a0
GH-2177: Remove broken page pings (#609)
benstrumeyer Sep 30, 2020
98895ab
GH-2158: Subscription_type ping parameter not sending on login (#610)
benstrumeyer Oct 2, 2020
5b86f6c
GH-2097/t2-to-utm-content-fix (#612)
wlycdgr Oct 2, 2020
eafc209
update translations
christophertino Oct 2, 2020
4f9b05b
udpate travis.yml
christophertino Oct 2, 2020
cfad922
update Changelog
christophertino Oct 2, 2020
3c1a081
update readme
christophertino Oct 2, 2020
45832c2
Fix bug that always made ABTest clients think tests had not been fetc…
wlycdgr Oct 7, 2020
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

GH-2100, GH-2097: Onboarding test 2 (#603)
* Implement A/B test for hub with modified tabs

* Remove promo variant test, repurpose ping param

* Make comments and ternaries more clear

* Change param for A/B test

Co-authored-by: wlycdgr <ilya.zarembsky@gmail.com>
  • Loading branch information
leuryr and wlycdgr committed Sep 22, 2020
commit f1c89417e2a75e198af9f2a14e56d1edc5b4a202
@@ -15,8 +15,12 @@ import React from 'react';
import PropTypes from 'prop-types';
import ClassNames from 'classnames';
import { NavLink } from 'react-router-dom';
import QueryString from 'query-string';
import globals from '../../../../src/classes/Globals';

// Flag to display alternate hub view (used for A/B testing ticket GH-2097)
const ah = (QueryString.parse(window.location.search).ah === 'true') || false;

const { GHOSTERY_BASE_URL } = globals;

/**
@@ -97,6 +101,8 @@ const SideNavigationView = (props) => {
disabled: disableNav,
});

const menuClassNames = ClassNames(`SideNavigation__menu ${ah ? '' : 'flex-child-grow'} flex-container flex-dir-column`);

return (
<div className={containerClassNames}>
<a
@@ -106,7 +112,7 @@ const SideNavigationView = (props) => {
target="_blank"
className={topClassNames}
/>
<div className="SideNavigation__menu flex-child-grow flex-container flex-dir-column">
<div className={menuClassNames}>
{menuItems.map(item => _renderMenuItem(item, disableNav))}
</div>
<div className="SideNavigation__bottom flex-container flex-dir-column">
@@ -13,12 +13,16 @@

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import QueryString from 'query-string';
import SideNavigationView from './SideNavigationView';
import globals from '../../../../src/classes/Globals';

const { IS_CLIQZ, BROWSER_INFO } = globals;
const IS_ANDROID = (BROWSER_INFO.os === 'android');

// Flag to display alternate hub view (used for A/B testing ticket GH-2097)
const ah = (QueryString.parse(window.location.search).ah === 'true') || false;

/**
* @class Implement the Side Navigation View for the Ghostery Hub
* @extends Component
@@ -50,7 +54,10 @@ class SideNavigationViewContainer extends Component {
const { user, location } = this.props;
const disableRegEx = /^(\/setup(?!\/4$))|(\/tutorial(?!\/6$))/;

const menuItems = [
const menuItems = ah ? [
{ href: '/home', icon: 'home', text: t('hub_side_navigation_home') },
{ href: '/setup', icon: 'setup', text: t('customize_setup') },
] : [
{ href: '/home', icon: 'home', text: t('hub_side_navigation_home') },
{ href: '/', icon: 'shield', text: t('hub_side_navigation_upgrade_plan') },
{ href: '/setup', icon: 'setup', text: t('customize_setup') },
@@ -59,6 +66,7 @@ class SideNavigationViewContainer extends Component {
...((IS_CLIQZ || IS_ANDROID) ? [] : [{ href: '/rewards', icon: 'rewards', text: t('hub_side_navigation_rewards') }]),
...((IS_ANDROID) ? [] : [{ href: '/products', icon: 'products', text: t('hub_side_navigation_products') }])
];

const bottomItems = user ? [
{ id: 'email', href: `${globals.ACCOUNT_BASE_URL}/`, text: user.email },
{ id: 'logout', text: t('sign_out'), clickHandler: this._handleLogoutClick },
@@ -17,6 +17,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter as Router, Route } from 'react-router-dom';
import { Provider } from 'react-redux';
import QueryString from 'query-string';
import createStore from './createStore';

// Containers
@@ -34,14 +35,17 @@ import UpgradePlanView from './Views/UpgradePlanView';

const store = createStore();

// Flag to display alternate hub view (used for A/B testing ticket GH-2097)
const ah = (QueryString.parse(window.location.search).ah === 'true') || false;

/**
* Top-Level Component for the Ghostery Hub
* @memberof HubComponents
*/
const Hub = () => (
<AppView>
<Route exact path="/" component={UpgradePlanView} />
<Route exact path="/home" component={HomeView} />
<Route exact path="/home" component={ah ? UpgradePlanView : HomeView} />
<Route path="/setup" component={SetupView} />
<Route path="/tutorial" component={TutorialView} />
<Route exact path="/plus" component={PlusView} />
@@ -114,5 +114,6 @@
"cliqz/offers-templates/reminder.html",
"cliqz/offers-templates/checkout.html",
"cliqz/offers-templates/control-center.html"
]
],
"debug": true
}
@@ -1111,26 +1111,20 @@ function getAntitrackingTestConfig() {
}

/**
* Set option for Hub promo A/B/C test based
* Set option for Hub Layout A/B test based
* on the results returned from the abtest endpoint.
* @memberOf Background
*
* @return {Object} Hub promotion configuration parameters
*/
function setupHubPromoABTest() {
function setupHubLayoutABTest() {
if (
!abtest.hasBeenFetched
|| conf.hub_promo_variant !== 'not_yet_set'
) {
return;
}
|| conf.hub_layout !== 'not_yet_set'
) { return; }

if (abtest.hasTest('hub_plain')) {
conf.hub_promo_variant = 'plain';
} else if (abtest.hasTest('hub_midnight')) {
conf.hub_promo_variant = 'midnight';
if (abtest.hasTest('hub_alternate')) {
conf.hub_layout = 'alternate';
} else {
conf.hub_promo_variant = 'upgrade';
conf.hub_layout = 'default';
}
}

@@ -1155,7 +1149,7 @@ function setupABTest() {
cliqz.prefs.set('attrackBloomFilter', false);
}

setupHubPromoABTest();
setupHubLayoutABTest();
}

/**
@@ -1764,10 +1758,10 @@ function initializeGhosteryModules() {
// 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') && !IS_ANDROID) ? '' : '#home';
const showPremiumPromoModal = (conf.hub_promo_variant === 'midnight' && !IS_ANDROID);
const showAlternateHub = conf.hub_layout === 'alternate';
const route = showAlternateHub ? '#home' : '';
chrome.tabs.create({
url: chrome.runtime.getURL(`./app/templates/hub.html?$justInstalled=true&pm=${showPremiumPromoModal}${route}`),
url: chrome.runtime.getURL(`./app/templates/hub.html?$justInstalled=true&ah=${showAlternateHub}${route}`),
active: true
});
}
@@ -116,7 +116,7 @@ class ConfData {
_initProperty('enable_smart_block', true);
_initProperty('expand_all_trackers', true);
_initProperty('hide_alert_trusted', false);
_initProperty('hub_promo_variant', 'not_yet_set');
_initProperty('hub_layout', 'not_yet_set');
_initProperty('ignore_first_party', true);
_initProperty('import_callout_dismissed', true);
_initProperty('insights_promo_modal_last_seen', 0);
@@ -369,8 +369,8 @@ class Metrics {
`&th=${encodeURIComponent(Metrics._getThemeValue().toString())}` +

// New parameters for Ghostery 8.5.2
// Hub Promo variant
`&hp=${encodeURIComponent(Metrics._getHubPromoVariant().toString())}` +
// Hub Layout View
`&t2=${encodeURIComponent(Metrics._getHubLayoutView().toString())}` +
// Subscription Interval
`&si=${encodeURIComponent(Metrics._getSubscriptionInterval().toString())}` +
// Product ID Parameter
@@ -534,20 +534,18 @@ class Metrics {
}

/**
* Get the Int associated with the Hub promo variant shown on install
* Get the Int associated with the Hub layout view shown on install
* @private
* @return {number} Int associated with the Hub promo variant
* @return {number} Int associated with the Hub layout view
*/
static _getHubPromoVariant() {
const { hub_promo_variant } = conf;
static _getHubLayoutView() {
const { hub_layout } = conf;

switch (hub_promo_variant) {
case 'upgrade':
switch (hub_layout) {
case 'default':
return 1;
case 'plain':
case 'alternate':
return 2;
case 'midnight':
return 3;
case 'not_yet_set':
default:
return 0;
ProTip! Use n and p to navigate between commits in a pull request.