Remove MS Store experiment code (#11090)

This commit is contained in:
Alex Gibson 2024-07-26 10:51:52 +01:00
Родитель ee46865e32
Коммит b7e331db8a
6 изменённых файлов: 5 добавлений и 199 удалений

Просмотреть файл

@ -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') %}
<div class="mzp-c-button-download-container">
<a href="{{ ms_store_href }}" class="ga-product-download mzp-c-button mzp-t-product mzp-t-secondary mzp-t-md" data-cta-type="button" data-cta-text="Download Firefox">
Download Firefox
</a>
</div>
<div class="c-navigation-vpn-cta-container">
{{ 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'
}
) }}
</div>
{% 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) }}
<div class="c-intro-download-alt">
<a href="{{ url('firefox.download.thanks') }}" data-cta-type="link" data-cta-text="Download from the web">
Download from the web
</a>
</div>
<small class="mzp-c-button-download-privacy-link">
<a href="{{ url('privacy.notices.firefox') }}">
{{ ftl('download-button-firefox-privacy-notice') }}
</a>
</small>
{% endblock %}
{% block firefox_secondary_download_cta %}
<div class="mzp-u-centered">
{% 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) }}
<small class="mzp-c-button-download-privacy-link">
<a href="{{ url('privacy.notices.firefox') }}">
{{ ftl('download-button-firefox-privacy-notice') }}
</a>
</small>
</div>
{% endblock %}
{% block firefox_tertiary_download_cta %}
<div class="mzp-u-centered">
{% 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) }}
<small class="mzp-c-button-download-privacy-link">
<a href="{{ url('privacy.notices.firefox') }}">
{{ ftl('download-button-firefox-privacy-notice') }}
</a>
</small>
</div>
{% endblock %}

Просмотреть файл

@ -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 @@
<h2 class="mzp-has-zap-7">{{ ftl('firefox-desktop-download-get-the-browser') }}</h2>
<p>{{ ftl('firefox-desktop-download-no-shady') }}</p>
<div class="c-intro-download">
{% 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') }}
<div class="c-intro-download-alt"><a href="{{ url('firefox.all') }}">{{ ftl('firefox-desktop-download-download-options') }}</a></div>
@ -394,9 +384,7 @@
</ul>
</div>
</div>
{% 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') }}
</div>
</section>
@ -557,9 +545,7 @@
<p>{{ ftl('firefox-desktop-download-from-watching-a') }}</p>
</div>
</div>
{% 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') }}
</section>
<section class="c-support">

Просмотреть файл

@ -431,28 +431,6 @@ class TestFirefoxNew(TestCase):
# 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):

Просмотреть файл

@ -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 @@ class NewView(L10nTemplateView):
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"

Просмотреть файл

@ -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();

Просмотреть файл

@ -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",