diff --git a/bedrock/firefox/templates/firefox/whatsnew/whatsnew-fx68-trailhead.html b/bedrock/firefox/templates/firefox/whatsnew/whatsnew-fx68-trailhead.html index 544de1eb7e5..657ec971739 100644 --- a/bedrock/firefox/templates/firefox/whatsnew/whatsnew-fx68-trailhead.html +++ b/bedrock/firefox/templates/firefox/whatsnew/whatsnew-fx68-trailhead.html @@ -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' %} diff --git a/media/js/firefox/whatsnew/experiment-whatsnew-68-de.js b/media/js/firefox/whatsnew/experiment-whatsnew-68-de.js index 4d930c09a60..f4c1cd7d7cc 100644 --- a/media/js/firefox/whatsnew/experiment-whatsnew-68-de.js +++ b/media/js/firefox/whatsnew/experiment-whatsnew-68-de.js @@ -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 } }); diff --git a/media/js/firefox/whatsnew/experiment-whatsnew-68-enCA.js b/media/js/firefox/whatsnew/experiment-whatsnew-68-enCA.js index f197f081aeb..43dcc6ce738 100644 --- a/media/js/firefox/whatsnew/experiment-whatsnew-68-enCA.js +++ b/media/js/firefox/whatsnew/experiment-whatsnew-68-enCA.js @@ -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 } }); diff --git a/media/js/firefox/whatsnew/experiment-whatsnew-68-enUSGB.js b/media/js/firefox/whatsnew/experiment-whatsnew-68-enGB.js similarity index 84% rename from media/js/firefox/whatsnew/experiment-whatsnew-68-enUSGB.js rename to media/js/firefox/whatsnew/experiment-whatsnew-68-enGB.js index 1328a925105..4d930c09a60 100644 --- a/media/js/firefox/whatsnew/experiment-whatsnew-68-enUSGB.js +++ b/media/js/firefox/whatsnew/experiment-whatsnew-68-enGB.js @@ -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 } }); diff --git a/media/js/firefox/whatsnew/experiment-whatsnew-68-enUS.js b/media/js/firefox/whatsnew/experiment-whatsnew-68-enUS.js new file mode 100644 index 00000000000..4c9b9c7ccf5 --- /dev/null +++ b/media/js/firefox/whatsnew/experiment-whatsnew-68-enUS.js @@ -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); diff --git a/media/js/firefox/whatsnew/experiment-whatsnew-68-fr.js b/media/js/firefox/whatsnew/experiment-whatsnew-68-fr.js index 8654b650e4a..43dcc6ce738 100644 --- a/media/js/firefox/whatsnew/experiment-whatsnew-68-fr.js +++ b/media/js/firefox/whatsnew/experiment-whatsnew-68-fr.js @@ -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 } }); diff --git a/media/static-bundles.json b/media/static-bundles.json index 14fc91c8062..059c566da3d 100644 --- a/media/static-bundles.json +++ b/media/static-bundles.json @@ -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": [ @@ -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",