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

[fix #7547] Adjust WNP68 experiment #7548

Merged
merged 1 commit into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@

{% block experiments %}
{% if switch('experiment_whatsnew_68', ['en-US','en-CA','en-GB','fr','de']) %}
{% if LANG in ['en-US', 'en-GB'] %}
{{ js_bundle('experiment-whatsnew-68-enUSGB') }}
{% if LANG == 'en-US' %}
{{ js_bundle('experiment-whatsnew-68-enUS') }}
{% elif LANG == 'en-CA' %}
{{ js_bundle('experiment-whatsnew-68-enCA') }}
{% elif LANG == 'en-GB' %}
{{ js_bundle('experiment-whatsnew-68-enGB') }}
{% elif LANG == 'fr' %}
{{ js_bundle('experiment-whatsnew-68-fr') }}
{% elif LANG == 'de' %}
Expand Down
10 changes: 5 additions & 5 deletions media/js/firefox/whatsnew/experiment-whatsnew-68-de.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
var deckard = new Mozilla.TrafficCop({
id: 'experiment_firefox_whatsnew_68',
variations: {
'v=a': 2, // control
'v=b': 2, // new layout, light
'v=c': 2, // new layout, dark
'v=d': 2, // notification favicon
'v=e': 2 // monitor CTA
'v=a': 10, // control
'v=b': 10, // new layout, light
'v=c': 10, // new layout, dark
'v=d': 10, // notification favicon
'v=e': 10 // monitor CTA
}
});

Expand Down
10 changes: 5 additions & 5 deletions media/js/firefox/whatsnew/experiment-whatsnew-68-enCA.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
var deckard = new Mozilla.TrafficCop({
id: 'experiment_firefox_whatsnew_68',
variations: {
'v=a': 4, // control
'v=b': 4, // new layout, light
'v=c': 4, // new layout, dark
'v=d': 4, // notification favicon
'v=e': 4 // monitor CTA
'v=a': 14, // control
'v=b': 14, // new layout, light
'v=c': 14, // new layout, dark
'v=d': 14, // notification favicon
'v=e': 14 // monitor CTA
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
var deckard = new Mozilla.TrafficCop({
id: 'experiment_firefox_whatsnew_68',
variations: {
'v=a': 1, // control
'v=b': 1, // new layout, light
'v=c': 1, // new layout, dark
'v=d': 1, // notification favicon
'v=e': 1 // monitor CTA
'v=a': 2, // control
'v=b': 2, // new layout, light
'v=c': 2, // new layout, dark
'v=d': 2, // notification favicon
'v=e': 2 // monitor CTA
}
});

Expand Down
44 changes: 44 additions & 0 deletions media/js/firefox/whatsnew/experiment-whatsnew-68-enUS.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */


(function() {
'use strict';

// Exclude signed in users
function fxaSignedOut() {
Mozilla.Client.getFxaDetails(function(details) {
if (!details.setup) {
return true;
} else {
return false;
}
});
}

// courtesy of https://davidwalsh.name/query-string-javascript
function getUrlParam(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}

// if we already have a `v` parameter on the page, or the user is signed into Sync, don't enter into the experiment.
if (!getUrlParam('v') && fxaSignedOut) {
var deckard = new Mozilla.TrafficCop({
id: 'experiment_firefox_whatsnew_68',
variations: {
'v=a': 5, // control
'v=b': 5, // new layout, light
'v=c': 5, // new layout, dark
'v=d': 5, // notification favicon
'v=e': 5 // monitor CTA
}
});

deckard.init();
}

})(window.Mozilla);
10 changes: 5 additions & 5 deletions media/js/firefox/whatsnew/experiment-whatsnew-68-fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
var deckard = new Mozilla.TrafficCop({
id: 'experiment_firefox_whatsnew_68',
variations: {
'v=a': 3, // control
'v=b': 3, // new layout, light
'v=c': 3, // new layout, dark
'v=d': 3, // notification favicon
'v=e': 3 // monitor CTA
'v=a': 14, // control
'v=b': 14, // new layout, light
'v=c': 14, // new layout, dark
'v=d': 14, // notification favicon
'v=e': 14 // monitor CTA
}
});

Expand Down
12 changes: 10 additions & 2 deletions media/static-bundles.json
Original file line number Diff line number Diff line change
Expand Up @@ -1024,9 +1024,9 @@
"files": [
"js/libs/mozilla-traffic-cop.js",
"js/base/mozilla-client.js",
"js/firefox/whatsnew/experiment-whatsnew-68-enUSGB.js"
"js/firefox/whatsnew/experiment-whatsnew-68-enUS.js"
],
"name": "experiment-whatsnew-68-enUSGB"
"name": "experiment-whatsnew-68-enUS"
},
{
"files": [
Expand All @@ -1036,6 +1036,14 @@
],
"name": "experiment-whatsnew-68-enCA"
},
{
"files": [
"js/libs/mozilla-traffic-cop.js",
"js/base/mozilla-client.js",
"js/firefox/whatsnew/experiment-whatsnew-68-enGB.js"
],
"name": "experiment-whatsnew-68-enGB"
},
{
"files": [
"js/libs/mozilla-traffic-cop.js",
Expand Down