From b7e331db8a1d773341e58ea4ca30b1a0a73f88d0 Mon Sep 17 00:00:00 2001 From: Alex Gibson Date: Fri, 26 Jul 2024 10:51:52 +0100 Subject: [PATCH] Remove MS Store experiment code (#11090) --- .../new/desktop/download-ms-store.html | 83 ------------------- .../firefox/new/desktop/download.html | 20 +---- bedrock/firefox/tests/test_views.py | 22 ----- bedrock/firefox/views.py | 10 +-- .../new/desktop/download-ms-store-exp.es6.js | 63 -------------- media/static-bundles.json | 6 -- 6 files changed, 5 insertions(+), 199 deletions(-) delete mode 100644 bedrock/firefox/templates/firefox/new/desktop/download-ms-store.html delete mode 100644 media/js/firefox/new/desktop/download-ms-store-exp.es6.js diff --git a/bedrock/firefox/templates/firefox/new/desktop/download-ms-store.html b/bedrock/firefox/templates/firefox/new/desktop/download-ms-store.html deleted file mode 100644 index a2005b86c96..00000000000 --- a/bedrock/firefox/templates/firefox/new/desktop/download-ms-store.html +++ /dev/null @@ -1,83 +0,0 @@ -{# - 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 https://mozilla.org/MPL/2.0/. -#} - -{% from "macros.html" import ms_store_button with context %} - -{% extends "firefox/new/desktop/download.html" %} - -{% set ms_store_attribution_code = 'experiment%3Dmozorg%2Dfirefox%2Dvsinstaller%2Dexp%26variation%3Dtreatment' %} - -{% macro custom_nav_cta() %} - {% set ms_store_href = ms_store_url(product='firefox', campaign=ms_store_attribution_code, handler='ms-windows-store') %} -
- - Download Firefox - -
- -
- {{ vpn_product_referral_link( - referral_id='navigation', - page_anchor='#pricing', - link_text=ftl('navigation-v2-get-mozilla-vpn'), - class_name='mzp-t-product mzp-t-secondary mzp-t-md', - optional_attributes= { - 'data-cta-text' : 'Get Mozilla VPN', - 'data-cta-type' : 'button', - 'data-cta-position' : 'navigation' - } - ) }} -
-{% endmacro %} - -{% block site_header %} - {% with custom_nav_cta=custom_nav_cta() %} - {% include 'includes/protocol/navigation/navigation.html' %} - {% endwith %} -{% endblock %} - -{% block firefox_primary_download_cta %} - {% set ms_store_href = ms_store_url(product='firefox', campaign=ms_store_attribution_code, handler='ms-windows-store') %} - {{ ms_store_button(href=ms_store_href) }} - -
- - Download from the web - -
- - - - {{ ftl('download-button-firefox-privacy-notice') }} - - -{% endblock %} - -{% block firefox_secondary_download_cta %} -
- {% set ms_store_href = ms_store_url(product='firefox', campaign=ms_store_attribution_code, handler='ms-windows-store') %} - {{ ms_store_button(href=ms_store_href) }} - - - - {{ ftl('download-button-firefox-privacy-notice') }} - - -
-{% endblock %} - -{% block firefox_tertiary_download_cta %} -
- {% set ms_store_href = ms_store_url(product='firefox', campaign=ms_store_attribution_code, handler='ms-windows-store') %} - {{ ms_store_button(href=ms_store_href) }} - - - - {{ ftl('download-button-firefox-privacy-notice') }} - - -
-{% endblock %} diff --git a/bedrock/firefox/templates/firefox/new/desktop/download.html b/bedrock/firefox/templates/firefox/new/desktop/download.html index fdb3ec80fec..5ca769f7fc6 100644 --- a/bedrock/firefox/templates/firefox/new/desktop/download.html +++ b/bedrock/firefox/templates/firefox/new/desktop/download.html @@ -23,14 +23,6 @@ {% endif %} {% endblock %} -{% set show_firefox_ms_store_exp = switch('experiment-firefox-ms-store', ['en']) and country_code in ["US", "CA"] %} - -{% block experiments %} - {% if show_firefox_ms_store_exp %} - {{ js_bundle('firefox-ms-store-exp') }} - {% endif %} -{% endblock %} - {% block extrahead %} {{ super() }} {{ css_bundle('protocol-card') }} @@ -97,9 +89,7 @@

{{ ftl('firef

{{ ftl('firefox-desktop-download-get-the-browser') }}

{{ ftl('firefox-desktop-download-no-shady') }}

- {% block firefox_primary_download_cta %} - {{ download_firefox_thanks(locale_in_transition=True, download_location='primary cta') }} - {% endblock %} + {{ download_firefox_thanks(locale_in_transition=True, download_location='primary cta') }} @@ -394,9 +384,7 @@

{{ ftl('firefox-desktop-download-customize-your-brows

- {% block firefox_secondary_download_cta %} - {{ download_firefox_thanks(dom_id='download-features', locale_in_transition=True, download_location='features cta') }} - {% endblock %} + {{ download_firefox_thanks(dom_id='download-features', locale_in_transition=True, download_location='features cta') }} @@ -557,9 +545,7 @@

{{ ftl('firefox-desktop-download-picture-in-picture')

{{ ftl('firefox-desktop-download-from-watching-a') }}

- {% block firefox_tertiary_download_cta %} - {{ download_firefox_thanks(dom_id='download-discover', locale_in_transition=True, download_location='discover cta') }} - {% endblock %} + {{ download_firefox_thanks(dom_id='download-discover', locale_in_transition=True, download_location='discover cta') }}
diff --git a/bedrock/firefox/tests/test_views.py b/bedrock/firefox/tests/test_views.py index accd99a0f63..ed55fe0af8f 100644 --- a/bedrock/firefox/tests/test_views.py +++ b/bedrock/firefox/tests/test_views.py @@ -431,28 +431,6 @@ def test_thanks_basic_direct(self, render_mock): # end /thanks?s=direct URL - issue 10520 - # begin firefox ms store experiment tests - issue 11090 - - @patch.object(views, "ftl_file_is_active", lambda *x: True) - def test_ms_store_exp_v1(self, render_mock): - req = RequestFactory().get("/firefox/new/?experiment=mozorg-firefox-vsinstaller-exp&variation=control") - req.locale = "en-US" - view = views.NewView.as_view() - view(req) - template = render_mock.call_args[0][1] - assert template == ["firefox/new/desktop/download.html"] - - @patch.object(views, "ftl_file_is_active", lambda *x: True) - def test_ms_store_exp_v2(self, render_mock): - req = RequestFactory().get("/firefox/new/?experiment=mozorg-firefox-vsinstaller-exp&variation=treatment") - req.locale = "en-US" - view = views.NewView.as_view() - view(req) - template = render_mock.call_args[0][1] - assert template == ["firefox/new/desktop/download-ms-store.html"] - - # end firefox ms store experiment tests - issue 11090 - class TestFirefoxNewNoIndex(TestCase): def test_download_noindex(self): diff --git a/bedrock/firefox/views.py b/bedrock/firefox/views.py index 166f0c72c2e..cf70171d2e7 100644 --- a/bedrock/firefox/views.py +++ b/bedrock/firefox/views.py @@ -661,7 +661,6 @@ class NewView(L10nTemplateView): ftl_files_map = { "firefox/new/basic/base_download.html": ["firefox/new/download"], "firefox/new/desktop/download.html": ["firefox/new/desktop"], - "firefox/new/desktop/download-ms-store.html": ["firefox/new/desktop"], } activation_files = [ "firefox/new/download", @@ -669,7 +668,7 @@ class NewView(L10nTemplateView): ] # place expected ?v= values in this list - variations = ["control", "treatment"] + variations = [] def get(self, *args, **kwargs): # Remove legacy query parameters (Bug 1236791) @@ -710,18 +709,13 @@ def get_context_data(self, **kwargs): def get_template_names(self): variation = self.request.GET.get("variation", None) experience = self.request.GET.get("xv", None) - experiment = self.request.GET.get("experiment", None) - locale = l10n_utils.get_locale(self.request) # ensure variant matches pre-defined value if variation not in self.variations: variation = None if ftl_file_is_active("firefox/new/desktop") and experience != "basic": - if locale.startswith("en-") and experiment == "mozorg-firefox-vsinstaller-exp" and variation == "treatment": - template = "firefox/new/desktop/download-ms-store.html" - else: - template = "firefox/new/desktop/download.html" + template = "firefox/new/desktop/download.html" else: template = "firefox/new/basic/base_download.html" diff --git a/media/js/firefox/new/desktop/download-ms-store-exp.es6.js b/media/js/firefox/new/desktop/download-ms-store-exp.es6.js deleted file mode 100644 index c5de3a2c2d2..00000000000 --- a/media/js/firefox/new/desktop/download-ms-store-exp.es6.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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 https://mozilla.org/MPL/2.0/. - */ - -import TrafficCop from '@mozmeao/trafficcop'; -import { isApprovedToRun } from '../../../base/experiment-utils.es6.js'; - -const href = window.location.href; - -function isWindows10Plus() { - const match = navigator.userAgent.match(/Windows NT (\d+\.\d+)/); - return match && parseFloat(match[1]) >= 10.0; -} - -function isFirefox() { - return ( - /\s(Firefox|FxiOS)/.test(navigator.userAgent) && - !/Iceweasel|IceCat|SeaMonkey|Camino|like Firefox/i.test( - navigator.userAgent - ) - ); -} - -const initTrafficCop = () => { - if ( - href.indexOf( - 'experiment=mozorg-firefox-vsinstaller-exp&variation=control' - ) !== -1 - ) { - window.dataLayer.push({ - event: 'experiment_view', - id: 'mozorg-firefox-vsinstaller-exp', - variant: 'control' - }); - } else if ( - href.indexOf( - 'experiment=mozorg-firefox-vsinstaller-exp&variation=treatment' - ) !== -1 - ) { - window.dataLayer.push({ - event: 'experiment_view', - id: 'mozorg-firefox-vsinstaller-exp', - variant: 'treatment' - }); - } else if (TrafficCop) { - /** - * Experiment is targeted at Windows 10 or greater and non-Firefox browsers. - */ - if (isApprovedToRun() && isWindows10Plus() && !isFirefox()) { - const cop = new TrafficCop({ - variations: { - 'experiment=mozorg-firefox-vsinstaller-exp&variation=control': 25, - 'experiment=mozorg-firefox-vsinstaller-exp&variation=treatment': 25 - } - }); - cop.init(); - } - } -}; - -initTrafficCop(); diff --git a/media/static-bundles.json b/media/static-bundles.json index 5f3940f50cc..ecf738e346f 100644 --- a/media/static-bundles.json +++ b/media/static-bundles.json @@ -1338,12 +1338,6 @@ ], "name": "firefox_new_thanks_direct" }, - { - "files": [ - "js/firefox/new/desktop/download-ms-store-exp.es6.js" - ], - "name": "firefox-ms-store-exp" - }, { "files": [ "js/base/stub-attribution/stub-attribution.js",