зеркало из https://github.com/mozilla/bedrock.git
Родитель
529ba2b27e
Коммит
b2c56cbf92
|
@ -4,8 +4,8 @@
|
|||
file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
#}
|
||||
|
||||
{% set android_url = firefox_adjust_url('android', 'app-store-banner') %}
|
||||
{% set ios_url = firefox_adjust_url('ios', 'app-store-banner') %}
|
||||
{% set android_url = play_store_url('firefox', 'app-store-banner') %}
|
||||
{% set ios_url = app_store_url('firefox', 'app-store-banner') %}
|
||||
|
||||
{% if ftl_has_messages('banner-firefox-app-store-title', 'banner-firefox-app-store-free-google-play', 'banner-firefox-app-store-free-app-store', 'ui-view') %}
|
||||
<aside class="c-banner hide-from-legacy-ie mzp-t-firefox t-native" id="firefox-app-store-banner">
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
#}
|
||||
|
||||
{% set android_url = focus_adjust_url('android', 'app-store-banner') %}
|
||||
{% set ios_url = focus_adjust_url('ios', 'app-store-banner') %}
|
||||
{% set android_url = play_store_url('focus', 'app-store-banner') %}
|
||||
{% set ios_url = app_store_url('focus', 'app-store-banner') %}
|
||||
|
||||
{% if ftl_has_messages('banner-firefox-focus-app-store-title', 'banner-firefox-app-store-free-google-play', 'banner-firefox-app-store-free-app-store', 'ui-view') %}
|
||||
<aside class="c-banner hide-from-legacy-ie mzp-t-firefox t-native" id="firefox-app-store-banner">
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
{{ css_bundle('chromebook') }}
|
||||
{% endblock %}
|
||||
|
||||
{% set android_url = firefox_adjust_url('android', 'firefox-browsers-chromebook') %}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-browsers-chromebook') %}
|
||||
|
||||
{% block site_header %}
|
||||
{% with hide_nav_cta=True %}
|
||||
|
@ -49,7 +49,7 @@
|
|||
<h4 class="mzp-c-menu-list-title">{{ ftl('browsers-chromebook-dropdown-copy') }}</h4>
|
||||
<ul class="mzp-c-menu-list-list download-platform-list">
|
||||
<li class="mzp-c-menu-list-item">
|
||||
<a href="{{ firefox_adjust_url('android', 'firefox-browsers-faq') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android">
|
||||
<a href="{{ android_url }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android">
|
||||
{{ ftl('browsers-chromebook-browsers-chromebook-get-firefox-for') }}
|
||||
<p><small>{{ ftl('browsers-chromebook-x86-based-chromebook') }}</small></p>
|
||||
</a>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
{# Download link should be locale neutral see issue 7982 #}
|
||||
<li class="mzp-c-menu-list-item"><a href="/firefox/download/thanks/" data-link-type="Desktop" data-download-os="Desktop" data-download-version="standard">{{ get_desktop }}</a></li>
|
||||
<!--<![endif]-->
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ firefox_adjust_url('android', 'firefox_home') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android"> {{ get_android }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ firefox_adjust_url('ios', 'firefox_home') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="iOS" data-download-version="ios" data-download-os="iOS">{{ get_ios }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ play_store_url('firefox', 'firefox-browsers-compare') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android"> {{ get_android }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ app_store_url('firefox', 'firefox-browsers-compare') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="iOS" data-download-version="ios" data-download-os="iOS">{{ get_ios }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -240,8 +240,8 @@
|
|||
|
||||
<p>{{ ftl('compare-safari-firefox-also-offers-a-similar-updated-v3', fallback='compare-safari-firefox-also-offers-a-similar-updated', attrs = 'href="%s" data-cta-text="Accounts" data-cta-type="link"'|safe|format(url('firefox.accounts'))) }}</p>
|
||||
|
||||
<p>{{ ftl('compare-safari-the-firefox-app-for-ios-and', ios='href="%s" rel="external noopener" data-cta-text="iOS" data-cta-type="link"'|safe|format(app_store_url('firefox')),
|
||||
android='href="%s" rel="external noopener" data-cta-text="Android" data-cta-type="link"'|safe|format(play_store_url('firefox'))) }}</p>
|
||||
<p>{{ ftl('compare-safari-the-firefox-app-for-ios-and', ios='href="%s" rel="external noopener" data-cta-text="iOS" data-cta-type="link"'|safe|format(app_store_url('firefox', campaign='firefox-browsers-compare-safari')),
|
||||
android='href="%s" rel="external noopener" data-cta-text="Android" data-cta-type="link"'|safe|format(play_store_url('firefox', campaign='firefox-browsers-compare-safari'))) }}</p>
|
||||
|
||||
<p>{{ ftl('compare-safari-since-safari-is-apples-proprietary') }}</p>
|
||||
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% set android_url = firefox_adjust_url('android', 'browsers-page') %}
|
||||
{% set ios_url = firefox_adjust_url('ios', 'browsers-page') %}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-browsers') %}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-browsers') %}
|
||||
{% set referrals = '?utm_source=www.mozilla.org&utm_medium=referral&utm_campaign=firefox-browsers' %}
|
||||
{% set _entrypoint = 'mozilla.org-firefox-browsers' %}
|
||||
|
||||
|
@ -149,8 +149,8 @@
|
|||
<div id="menu-mobile-wrapper" class="mzp-c-menu-list mzp-t-cta mzp-t-download">
|
||||
<h3 class="mzp-c-menu-list-title">{{ ftl('firefox-browsers-download-for-mobile') }}</h3>
|
||||
<ul class="mzp-c-menu-list-list" id="menu-mobile">
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ firefox_adjust_url('android', 'firefox_browsers') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android">{{ ftl('firefox-browsers-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ firefox_adjust_url('ios', 'firefox_browsers') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="iOS" data-download-version="ios" data-download-os="iOS">{{ ftl('firefox-browsers-ios') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ android_url }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android">{{ ftl('firefox-browsers-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ ios_url }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="iOS" data-download-version="ios" data-download-os="iOS">{{ ftl('firefox-browsers-ios') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item t-getapp"><a href="{{ url('firefox.browsers.mobile.get-app') }}" data-cta-type="link" data-cta-text="Get App Mobile">{{ ftl('firefox-browsers-send-me-a-link') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
{% set show_firefox_app_store_banner = switch('firefox-app-store-banner') %}
|
||||
{% set show_send_to_device = LANG in settings.SEND_TO_DEVICE_LOCALES %}
|
||||
{% set android_url = firefox_adjust_url('android', 'mobile-android-page') %}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-browsers-mobile-android') %}
|
||||
|
||||
{% block page_css %}
|
||||
{{ css_bundle('protocol-split') }}
|
||||
|
|
|
@ -16,10 +16,8 @@
|
|||
|
||||
{% set show_firefox_app_store_banner = switch('firefox-app-store-banner') %}
|
||||
{% set show_send_to_device = LANG in settings.SEND_TO_DEVICE_LOCALES %}
|
||||
{% set android_url = focus_adjust_url('android', 'mobile-focus-page') %}
|
||||
{% set variation_android_adjust_url = 'https://app.adjust.com/167k4ih?campaign=firefox-desktop&adgroup=pb&creative=focus-omc171-uk&redirect=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dorg.mozilla.focus' %}
|
||||
{% set variation_ios_adjust_url = 'https://app.adjust.com/167k4ih?campaign=firefox-desktop&adgroup=pb&creative=focus-omc171-uk&redirect=https%3A%2F%2Fapps.apple.com%2Fus%2Fapp%2Ffirefox-focus-privacy-browser%2Fid1055677337' %}
|
||||
{% set ios_url = focus_adjust_url('ios', 'mobile-focus-page') %}
|
||||
{% set android_url = play_store_url('focus', 'firefox-browsers-mobile-focus') %}
|
||||
{% set ios_url = app_store_url('focus', 'firefox-browsers-mobile-focus') %}
|
||||
|
||||
{% block page_css %}
|
||||
{{ css_bundle('protocol-split') }}
|
||||
|
@ -68,18 +66,10 @@
|
|||
<ul class="mobile-download-buttons">
|
||||
|
||||
<li class="android">
|
||||
{% if variation == 'pb' %}
|
||||
{{ google_play_button(href=variation_android_adjust_url, id="playStoreLink-primary")}}
|
||||
{% else %}
|
||||
{{ google_play_button(href=android_url, id='playStoreLink-primary') }}
|
||||
{% endif %}
|
||||
{{ google_play_button(href=android_url, id='playStoreLink-primary') }}
|
||||
</li>
|
||||
<li class="ios">
|
||||
{% if variation == 'pb' %}
|
||||
{{ apple_app_store_button(href=variation_ios_adjust_url, id='appStoreLink-primary') }}
|
||||
{% else %}
|
||||
{{ apple_app_store_button(href=ios_url, id='appStoreLink-primary') }}
|
||||
{% endif %}
|
||||
{{ apple_app_store_button(href=ios_url, id='appStoreLink-primary') }}
|
||||
</li>
|
||||
</ul>
|
||||
{% endcall %}
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
{% endblock %}
|
||||
|
||||
{% set message_set = 'fx-mobile-download-desktop' %}
|
||||
{% set android_url = firefox_adjust_url('android', 'mobile-get-app-page') %}
|
||||
{% set ios_url = firefox_adjust_url('ios', 'mobile-get-app-page') %}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-browsers-mobile-get-app') %}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-browsers-mobile-get-app') %}
|
||||
|
||||
{% block content %}
|
||||
<main class="mzp-l-content mzp-t-content-md mzp-t-firefox">
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
{{ ftl('get-ios-firefox-mobile-adapts') }}
|
||||
</p>
|
||||
<p class="c-cta">
|
||||
{{ apple_app_store_button(href='https://nn8g.adj.st/?adjust_t=ucunb4r') }}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-browsers-mobile-get-ios') %}
|
||||
{{ apple_app_store_button(href=ios_url) }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
{% extends "firefox/base/base-protocol.html" %}
|
||||
|
||||
{% set show_firefox_app_store_banner = switch('firefox-app-store-banner') %}
|
||||
{% set android_url = firefox_adjust_url('android', 'mobile-page') %}
|
||||
{% set ios_url = firefox_adjust_url('ios', 'mobile-page') %}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-browsers-mobile') %}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-browsers-mobile') %}
|
||||
{% set referrals = '?utm_source=www.mozilla.org&utm_medium=referral&utm_campaign=firefox-mobile' %}
|
||||
{% set _entrypoint = 'mozilla.org-firefox-mobile' %}
|
||||
|
||||
|
@ -87,7 +87,7 @@
|
|||
<p>{{ ftl('browsers-mobile-infinitely-customizable-private') }}</p>
|
||||
|
||||
<p id="android-download">
|
||||
<a class="mzp-c-cta-link ga-product-download" href="{{ firefox_adjust_url('android', 'firefox_browsers') }}" rel="external noopener" data-link-type="download" data-display-name="Download" data-download-version="android" data-download-os="Android">{{ ftl('browsers-mobile-download') }}</a>
|
||||
<a class="mzp-c-cta-link ga-product-download" href="{{ android_url }}" rel="external noopener" data-link-type="download" data-display-name="Download" data-download-version="android" data-download-os="Android">{{ ftl('browsers-mobile-download') }}</a>
|
||||
</p>
|
||||
|
||||
<p><a class="mzp-c-cta-link ga-product-download" href="{{ url('firefox.browsers.mobile.android') }}" data-cta-type="link" data-cta-text="Android Learn More">{{ ftl('ui-learn-more') }}</a></p>
|
||||
|
@ -109,7 +109,7 @@
|
|||
<p>{{ ftl('browsers-mobile-get-enhanced-tracking-protection') }}</p>
|
||||
|
||||
<p id="ios-download">
|
||||
<a class="mzp-c-cta-link ga-product-download" href="{{ firefox_adjust_url('ios', 'firefox_browsers') }}" rel="external noopener" data-link-type="download" data-display-name="Download" data-download-version="ios" data-download-os="iOS">{{ ftl('browsers-mobile-download') }}</a>
|
||||
<a class="mzp-c-cta-link ga-product-download" href="{{ ios_url }}" rel="external noopener" data-link-type="download" data-display-name="Download" data-download-version="ios" data-download-os="iOS">{{ ftl('browsers-mobile-download') }}</a>
|
||||
</p>
|
||||
|
||||
<p><a class="mzp-c-cta-link ga-product-download" href="{{ url('firefox.browsers.mobile.ios') }}" data-cta-type="link" data-cta-text="iOS Learn More">{{ ftl('ui-learn-more') }}</a></p>
|
||||
|
@ -133,8 +133,8 @@
|
|||
<div id="menu-focus-wrapper" class="mzp-c-menu-list mzp-t-cta mzp-t-download">
|
||||
<h3 class="mzp-c-menu-list-title">{{ ftl('browsers-mobile-download') }}</h3>
|
||||
<ul class="mzp-c-menu-list-list" id="menu-mobile">
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ focus_adjust_url('android', 'firefox_browsers') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android">{{ ftl('browsers-mobile-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ focus_adjust_url('ios', 'firefox_browsers') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="iOS" data-download-version="ios" data-download-os="iOS">{{ ftl('browsers-mobile-ios') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ play_store_url('focus', 'firefox-browsers-mobile') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android">{{ ftl('browsers-mobile-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ app_store_url('focus', 'firefox-browsers-mobile') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="iOS" data-download-version="ios" data-download-os="iOS">{{ ftl('browsers-mobile-ios') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
{% set show_firefox_app_store_banner = switch('firefox-app-store-banner') %}
|
||||
{% set show_send_to_device = LANG in settings.SEND_TO_DEVICE_LOCALES %}
|
||||
{% set ios_url = firefox_adjust_url('ios', 'mobile-ios-page') %}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-browsers-mobile-ios') %}
|
||||
|
||||
{% block page_css %}
|
||||
{{ css_bundle('protocol-split') }}
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
{% set referrals = '?utm_source=www.mozilla.org&utm_medium=referral&utm_campaign=' + _utm_campaign %}
|
||||
|
||||
{% set show_send_to_device = LANG in settings.SEND_TO_DEVICE_LOCALES %}
|
||||
{% set android_url = firefox_adjust_url('android', 'mobile-page') %}
|
||||
{% set ios_url = firefox_adjust_url('ios', 'mobile-page') %}
|
||||
{% set android_url = play_store_url('firefox', 'mobile-page') %}
|
||||
{% set ios_url = app_store_url('firefox', 'mobile-page') %}
|
||||
|
||||
{# meta data #}
|
||||
{% block page_title %}{{ info.title }}{% endblock %}
|
||||
|
|
|
@ -51,10 +51,10 @@
|
|||
|
||||
<ul>
|
||||
<li>
|
||||
{{ google_play_button(href=firefox_adjust_url('android', 'fb-container-page'), id='playStoreLink') }}
|
||||
{{ google_play_button(href=play_store_url('firefox', 'firefox-facebook-container'), id='playStoreLink') }}
|
||||
</li>
|
||||
<li>
|
||||
{{ apple_app_store_button(href=firefox_adjust_url('ios', 'fb-container-page'), id='appStoreLink') }}
|
||||
{{ apple_app_store_button(href=app_store_url('firefox', 'firefox-facebook-container'), id='appStoreLink') }}
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
|
|
@ -138,8 +138,8 @@
|
|||
<li class="mzp-c-menu-list-item menu-desktop-unsupported"><a href="{{ url('firefox.new') }}" class="ga-product-download" data-cta-type="link" data-cta-text="Firefox Desktop">{{ ftl('firefox-home-desktop') }}</a></li>
|
||||
{# Download link should be locale neutral see issue 7982 #}
|
||||
<li class="mzp-c-menu-list-item menu-desktop"><a href="/firefox/download/thanks/" class="ga-product-download" data-link-type="Desktop" data-download-os="Desktop" data-download-version="standard" data-link-text="Trackers">{{ ftl('firefox-home-desktop') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item menu-android"><a href="{{ firefox_adjust_url('android', 'firefox_home') }}" class="ga-product-download" rel="external noopener" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android" data-link-text="Trackers"> {{ ftl('firefox-home-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item menu-ios"><a href="{{ firefox_adjust_url('ios', 'firefox_home') }}" class="ga-product-download" rel="external noopener" data-link-type="download" data-display-name="iOS" data-download-version="ios" data-download-os="iOS" data-link-text="Trackers">{{ ftl('firefox-home-ios') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item menu-android"><a href="{{ play_store_url('firefox', 'firefox-home') }}" class="ga-product-download" rel="external noopener" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android" data-link-text="Trackers"> {{ ftl('firefox-home-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item menu-ios"><a href="{{ app_store_url('firefox', 'firefox-home') }}" class="ga-product-download" rel="external noopener" data-link-type="download" data-display-name="iOS" data-download-version="ios" data-download-os="iOS" data-link-text="Trackers">{{ ftl('firefox-home-ios') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<p id="test-fbc" class="js-fx-only"><a class="mzp-c-cta-link" href="https://addons.mozilla.org/firefox/addon/facebook-container/{{ referrals }}">{{ ftl('firefox-home-get-the-facebook-container') }}</a></p>
|
||||
|
@ -207,8 +207,8 @@
|
|||
<div class="mzp-c-menu-list mzp-t-cta mzp-t-download">
|
||||
<h5 class="mzp-c-menu-list-title">{{ ftl('firefox-home-download-the-app') }}</h5>
|
||||
<ul class="mzp-c-menu-list-list" id="menu-pocket">
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ pocket_adjust_url('android', 'firefox-home') }}" rel="external noopener" data-cta-type="link" data-cta-text="Download Pocket for Android" data-link-text="Pocket"> {{ ftl('firefox-home-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ pocket_adjust_url('ios', 'firefox-home') }}" rel="external noopener" data-cta-type="link" data-cta-text="Download Pocket for iOS" data-link-text="Pocket">{{ ftl('firefox-home-ios') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ play_store_url('pocket', 'firefox-home') }}" rel="external noopener" data-cta-type="link" data-cta-text="Download Pocket for Android" data-link-text="Pocket"> {{ ftl('firefox-home-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ app_store_url('pocket', 'firefox-home') }}" rel="external noopener" data-cta-type="link" data-cta-text="Download Pocket for iOS" data-link-text="Pocket">{{ ftl('firefox-home-ios') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<p><a class="mzp-c-cta-link" href="https://getpocket.com/signup/{{ referrals }}" rel="external noopener" data-cta-type="link" data-cta-text="Download for iOS" data-link-text="Pocket">{{ ftl('firefox-home-learn-more-about-pocket') }}</a></p>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
'firefox-desktop-download-just-download-the-browser',
|
||||
'firefox-desktop-download-get-more-from-firefox') %}
|
||||
{% set referrals = '?utm_source=www.mozilla.org&utm_medium=referral&utm_campaign=firefox-desktop' %}
|
||||
{% set ios_url = 'https://apps.apple.com/app/apple-store/id989804926?pt=373246&ct=mozilla-org-firefox-new&mt=8' %}
|
||||
{% set ios_url = app_store_url('firefox', 'mozilla-org-firefox-new') %}
|
||||
|
||||
{% block string_data %}{% endblock %}
|
||||
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% set android_url = firefox_adjust_url('android', 'products-page') %}
|
||||
{% set ios_url = firefox_adjust_url('ios', 'products-page') %}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-products') %}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-products') %}
|
||||
{% set referrals = '?utm_source=www.mozilla.org&utm_medium=referral&utm_campaign=firefox-products' %}
|
||||
{% set _entrypoint = 'mozilla.org-firefox-products' %}
|
||||
|
||||
|
@ -100,8 +100,8 @@
|
|||
{# Download link should be locale neutral see issue 7982 #}
|
||||
<li class="mzp-c-menu-list-item menu-desktop"><a href="/firefox/download/thanks/" data-link-type="Desktop" data-download-os="Desktop" data-download-version="standard">{{ ftl('firefox-products-desktop') }}</a></li>
|
||||
<!--<![endif]-->
|
||||
<li class="mzp-c-menu-list-item menu-android"><a href="{{ firefox_adjust_url('android', 'firefox_home') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android">{{ ftl('firefox-products-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item menu-ios"><a href="{{ firefox_adjust_url('ios', 'firefox_home') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="iOS" data-download-version="ios" data-download-os="iOS">{{ ftl('firefox-products-ios') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item menu-android"><a href="{{ android_url }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android">{{ ftl('firefox-products-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item menu-ios"><a href="{{ ios_url }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="iOS" data-download-version="ios" data-download-os="iOS">{{ ftl('firefox-products-ios') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<p><a class="mzp-c-cta-link" href="{{ url('firefox.browsers.index') }}" data-cta-type="link" data-cta-text="See all browsers">{{ ftl('firefox-products-see-all-browsers') }}</a></p>
|
||||
|
@ -124,8 +124,8 @@
|
|||
<h3 class="mzp-c-menu-list-title">{{ ftl('firefox-products-get-pocket') }}</h3>
|
||||
<ul class="mzp-c-menu-list-list" id="menu-pocket">
|
||||
<li class="mzp-c-menu-list-item t-web"><a href="https://getpocket.com/firefox_learnmore/{{ referrals }}" rel="external noopener" data-cta-type="link" data-cta-text="Pocket for Desktop">{{ ftl('firefox-products-desktop') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ pocket_adjust_url('android', 'firefox_products') }}" rel="external noopener" data-cta-type="link" data-cta-text="Download Pocket Android">{{ ftl('firefox-products-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ pocket_adjust_url('ios', 'firefox_products') }}" rel="external noopener" data-cta-type="link" data-cta-text="Download Pocket iOS">{{ ftl('firefox-products-ios') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ play_store_url('pocket', 'firefox-products') }}" rel="external noopener" data-cta-type="link" data-cta-text="Download Pocket Android">{{ ftl('firefox-products-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ app_store_url('pocket', 'firefox-products') }}" rel="external noopener" data-cta-type="link" data-cta-text="Download Pocket iOS">{{ ftl('firefox-products-ios') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
@ -151,8 +151,8 @@
|
|||
<div id="menu-focus-wrapper" class="mzp-c-menu-list mzp-t-cta mzp-t-download">
|
||||
<h3 class="mzp-c-menu-list-title">{{ ftl('download-button-download') }}</h3>
|
||||
<ul class="mzp-c-menu-list-list" id="menu-mobile">
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ focus_adjust_url('android', 'firefox_products') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android">{{ ftl('firefox-products-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ focus_adjust_url('ios', 'firefox_products') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="iOS" data-download-version="ios" data-download-os="iOS">{{ ftl('firefox-products-ios') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ play_store_url('focus', 'firefox-products') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="Android" data-download-version="android" data-download-os="Android">{{ ftl('firefox-products-android') }}</a></li>
|
||||
<li class="mzp-c-menu-list-item"><a href="{{ app_store_url('focus', 'firefox-products') }}" rel="external noopener" class="ga-product-download" data-link-type="download" data-display-name="iOS" data-download-version="ios" data-download-os="iOS">{{ ftl('firefox-products-ios') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
{% set page_id = 'data-gtm-page-id="/firefox/ios/releasenotes/"' %}
|
||||
{% set product_name = release.product %}
|
||||
{% set download_button_primary %}
|
||||
{{ apple_app_store_button(href=firefox_ios_url('mozorg-releasenotes_page-appstore-button'), id='download-ios-primary') }}
|
||||
{{ apple_app_store_button(href=app_store_url('firefox', 'firefox-release-notes'), id='download-ios-primary') }}
|
||||
{% endset %}
|
||||
{% set download_button_secondary %}
|
||||
{{ apple_app_store_button(href=firefox_ios_url('mozorg-releasenotes_page-appstore-button'), id='download-ios-secondary') }}
|
||||
{{ apple_app_store_button(href=app_store_url('firefox', 'firefox-release-notes'), id='download-ios-secondary') }}
|
||||
{% endset %}
|
||||
{% elif release.product == 'Firefox for Android' %}
|
||||
{% set page_id = 'data-gtm-page-id="/firefox/android/releasenotes/"' %}
|
||||
|
|
|
@ -24,21 +24,24 @@
|
|||
{% set main_tagline = 'Firefox blockierst du ganz einfach Tracker, verwaltest spielend deine Passwörter und passt deine Datenschutzeinstellungen mit wenigen Klicks an.' %}
|
||||
{% set qr_caption = 'Um loszulegen, scanne den QR-Code' %}
|
||||
{% set qr_alt = 'QR-Code zum Scannen für Firefox' %}
|
||||
{% set adjust_url = 'https://app.adjust.com/17szhv0y' %}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-welcome-17b-de') %}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-welcome-17b-de') %}
|
||||
{% elif LANG == "fr" %}
|
||||
{% set page_title = 'Nouvelle année, nouveau téléphone ? Téléchargez l’application Firefox.' %}
|
||||
{% set main_title = 'Nouvelle année, nouveau téléphone ?<br> Téléchargez l’application Firefox.'|safe %}
|
||||
{% set main_tagline = 'Bloquez les traqueurs, gérez vos mots de passe et personnalisez simplement vos paramètres de confidentialité avec Firefox, où que vous soyez.' %}
|
||||
{% set qr_caption = 'Scanner le code QR pour commencer' %}
|
||||
{% set qr_alt = 'Code QR à scanner pour Firefox' %}
|
||||
{% set adjust_url = 'https://app.adjust.com/17ckotcd' %}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-welcome-17b-fr') %}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-welcome-17b-fr') %}
|
||||
{% else %}
|
||||
{% set page_title = 'New year, new phone? Get the Firefox app.' %}
|
||||
{% set main_title = 'New year, new phone?<br> Get the Firefox app.'|safe %}
|
||||
{% set main_tagline = 'Block trackers, manage passwords and easily customize your privacy settings with Firefox on-the-go.' %}
|
||||
{% set qr_caption = 'Scan the QR code to get started' %}
|
||||
{% set qr_alt = 'QR code to scan for Firefox' %}
|
||||
{% set adjust_url = 'https://app.adjust.com/17py9i7o' %}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-welcome-17b') %}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-welcome-17b') %}
|
||||
{% endif %}
|
||||
|
||||
{% block shoulder_logo %}
|
||||
|
@ -83,10 +86,10 @@
|
|||
|
||||
<ul class="c-store-badges">
|
||||
<li class="c-store-badge-google">
|
||||
{{ google_play_button(href=adjust_url, id='playStoreLink') }}
|
||||
{{ google_play_button(href=android_url, id='playStoreLink') }}
|
||||
</li>
|
||||
<li class="c-store-badge-apple">
|
||||
{{ apple_app_store_button(href=adjust_url, id='appStoreLink') }}
|
||||
{{ apple_app_store_button(href=ios_url, id='appStoreLink') }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
{% block body_class %}{{ super() }} welcome-page4{% endblock %}
|
||||
|
||||
{% set show_send_to_device = LANG in settings.SEND_TO_DEVICE_LOCALES %}
|
||||
{% set android_url = firefox_adjust_url('android', 'welcome-4') %}
|
||||
{% set ios_url = firefox_adjust_url('ios', 'welcome-4') %}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-welcome-4') %}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-welcome-4') %}
|
||||
|
||||
{%block page_css %}
|
||||
{{ super()}}
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
{% set _entrypoint = 'mozilla.org-firefox-welcome-6' %}
|
||||
{% set _utm_campaign = 'welcome-6-default-browser' %}
|
||||
|
||||
{% set android_url = firefox_adjust_url('android', 'moments6') %}
|
||||
{% set ios_url = firefox_adjust_url('ios', 'moments6') %}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-welcome-6') %}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-welcome-6') %}
|
||||
{% set show_send_to_device = LANG in settings.SEND_TO_DEVICE_LOCALES %}
|
||||
|
||||
{%block page_css %}
|
||||
|
|
|
@ -46,10 +46,12 @@
|
|||
|
||||
<ul class="c-store-badges">
|
||||
<li class="c-store-badge-google">
|
||||
{{ google_play_button(href='https://app.adjust.com/10mpolq5', id='playStoreLink') }}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-whatsnew-114') %}
|
||||
{{ google_play_button(href=android_url, id='playStoreLink') }}
|
||||
</li>
|
||||
<li class="c-store-badge-apple">
|
||||
{{ apple_app_store_button(href='https://app.adjust.com/10mpolq5', id='appStoreLink') }}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-whatsnew-114') %}
|
||||
{{ apple_app_store_button(href=ios_url, id='appStoreLink') }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -17,10 +17,12 @@
|
|||
{% block header %}Go your own way with Firefox mobile{% endblock %}
|
||||
{% block body_copy %}Firefox mobile adapts to you and makes it easier than ever to see all your open tabs, past searches, and favorite sites.{% endblock %}
|
||||
{% block ios_badge %}
|
||||
{{ apple_app_store_button(href='https://app.adjust.com/jcn6eyw?campaign=firefox100&adgroup=ios-store', id='appStoreLink-primary', class_name='ios store-badge') }}
|
||||
{% set ios_url = app_store_url('firefox', 'firefox-landing-100') %}
|
||||
{{ apple_app_store_button(href=ios_url, id='appStoreLink-primary', class_name='ios store-badge') }}
|
||||
{% endblock %}
|
||||
{% block android_badge %}
|
||||
{{ google_play_button(href='https://app.adjust.com/jcn6eyw?campaign=firefox100&adgroup=android-store', id='playStoreLink-primary', class_name='android store-badge') }}
|
||||
{% set android_url = play_store_url('firefox', 'firefox-landing-100') %}
|
||||
{{ google_play_button(href=android_url, id='playStoreLink-primary', class_name='android store-badge') }}
|
||||
{% endblock %}
|
||||
{% block site_footer %}
|
||||
{% with theme_class='mzp-t-light' %}
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
{% set referrals = '?utm_source=www.mozilla.org&utm_medium=referral&utm_campaign=' + _utm_campaign %}
|
||||
|
||||
{% set show_send_to_device = LANG in settings.SEND_TO_DEVICE_LOCALES %}
|
||||
{% set android_url = firefox_adjust_url('android', _utm_campaign) %}
|
||||
{% set ios_url = firefox_adjust_url('ios', _utm_campaign) %}
|
||||
{% set android_url = play_store_url('firefox', _utm_campaign) %}
|
||||
{% set ios_url = app_store_url('firefox', _utm_campaign) %}
|
||||
|
||||
{# meta data #}
|
||||
{% block page_title %}{{ info.title }}{% endblock %}
|
||||
|
|
|
@ -8,7 +8,6 @@ import re
|
|||
import urllib.parse
|
||||
from os import path
|
||||
from os.path import splitext
|
||||
from urllib.parse import quote
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles.finders import find as find_static
|
||||
|
@ -24,7 +23,6 @@ from markupsafe import Markup
|
|||
from product_details import product_details
|
||||
|
||||
from bedrock.base.templatetags.helpers import static
|
||||
from bedrock.firefox.firefox_details import firefox_ios
|
||||
|
||||
ALL_FX_PLATFORMS = ("windows", "linux", "mac", "android", "ios")
|
||||
|
||||
|
@ -533,49 +531,6 @@ def absolute_url(url):
|
|||
return prefix + url
|
||||
|
||||
|
||||
@library.global_function
|
||||
@jinja2.pass_context
|
||||
def firefox_ios_url(ctx, ct_param=None):
|
||||
"""
|
||||
Output a link to the Firefox for iOS download page on the Apple App Store
|
||||
taking locales into account.
|
||||
|
||||
Use the locale from the current request. Check if the locale matches one of
|
||||
the Store's supported countries, return the localized page's URL or fall
|
||||
back to the default (English) page if not.
|
||||
|
||||
The optional ct_param is a campaign value for the app analytics.
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
In Template
|
||||
-----------
|
||||
|
||||
{{ firefox_ios_url() }}
|
||||
|
||||
For en-US this would output:
|
||||
|
||||
https://itunes.apple.com/us/app/firefox-private-safe-browser/id989804926
|
||||
|
||||
For es-ES this would output:
|
||||
|
||||
https://itunes.apple.com/es/app/firefox-private-safe-browser/id989804926
|
||||
|
||||
For ja this would output:
|
||||
|
||||
https://itunes.apple.com/jp/app/firefox-private-safe-browser/id989804926
|
||||
|
||||
"""
|
||||
locale = getattr(ctx["request"], "locale", "en-US")
|
||||
link = firefox_ios.get_download_url("release", locale)
|
||||
|
||||
if ct_param:
|
||||
return link + "?ct=" + ct_param
|
||||
|
||||
return link
|
||||
|
||||
|
||||
@library.filter
|
||||
def htmlattr(_list, **kwargs):
|
||||
"""
|
||||
|
@ -653,11 +608,20 @@ def ifeq(a, b, text):
|
|||
|
||||
@library.global_function
|
||||
@jinja2.pass_context
|
||||
def app_store_url(ctx, product):
|
||||
def app_store_url(ctx, product, campaign=None):
|
||||
"""Returns a localised app store URL for a given product"""
|
||||
base_url = getattr(settings, f"APPLE_APPSTORE_{product.upper()}_LINK")
|
||||
locale = getattr(ctx["request"], "locale", "en-US")
|
||||
countries = settings.APPLE_APPSTORE_COUNTRY_MAP
|
||||
params = "?pt=373246&ct={cmp}&mt=8"
|
||||
|
||||
if product == "focus" and locale == "de":
|
||||
base_url = getattr(settings, "APPLE_APPSTORE_KLAR_LINK")
|
||||
else:
|
||||
base_url = getattr(settings, f"APPLE_APPSTORE_{product.upper()}_LINK")
|
||||
|
||||
if campaign:
|
||||
base_url = base_url + params.format(cmp=campaign)
|
||||
|
||||
if locale in countries:
|
||||
return base_url.format(country=countries[locale])
|
||||
else:
|
||||
|
@ -666,10 +630,24 @@ def app_store_url(ctx, product):
|
|||
|
||||
@library.global_function
|
||||
@jinja2.pass_context
|
||||
def play_store_url(ctx, product):
|
||||
def play_store_url(ctx, product, campaign=None):
|
||||
"""Returns a localised play store URL for a given product"""
|
||||
locale = lang_short(ctx)
|
||||
base_url = getattr(settings, f"GOOGLE_PLAY_{product.upper()}_LINK")
|
||||
return f"{base_url}&hl={lang_short(ctx)}"
|
||||
params = "&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3D{cmp}"
|
||||
|
||||
if product == "focus" and locale == "de":
|
||||
base_url = getattr(settings, "GOOGLE_PLAY_KLAR_LINK")
|
||||
else:
|
||||
base_url = getattr(settings, f"GOOGLE_PLAY_{product.upper()}_LINK")
|
||||
|
||||
if campaign:
|
||||
base_url = base_url + params.format(cmp=campaign)
|
||||
|
||||
if locale:
|
||||
base_url = base_url + f"&hl={locale}"
|
||||
|
||||
return base_url
|
||||
|
||||
|
||||
@library.global_function
|
||||
|
@ -689,131 +667,6 @@ def native_language_name(ctx):
|
|||
return language["native"] if language else locale
|
||||
|
||||
|
||||
def _get_adjust_link(adjust_url, app_store_url, google_play_url, redirect, locale, product, adgroup, creative=None):
|
||||
link = adjust_url
|
||||
params = "campaign=www.mozilla.org&adgroup=" + adgroup
|
||||
redirect_url = None
|
||||
|
||||
# Get the appropriate app store URL to use as a fallback redirect.
|
||||
if redirect == "ios":
|
||||
countries = settings.APPLE_APPSTORE_COUNTRY_MAP
|
||||
if locale in countries:
|
||||
redirect_url = app_store_url.format(country=countries[locale])
|
||||
else:
|
||||
redirect_url = app_store_url.replace("/{country}/", "/")
|
||||
elif redirect == "android":
|
||||
redirect_url = google_play_url
|
||||
|
||||
# Optional creative parameter.
|
||||
if creative:
|
||||
params += "&creative=" + creative
|
||||
|
||||
params += "&mz_pr=" + product
|
||||
|
||||
if redirect_url:
|
||||
link += "?redirect=" + quote(redirect_url, safe="") + "&" + params + "&mz_pl=" + redirect
|
||||
else:
|
||||
link += "?" + params
|
||||
|
||||
return link
|
||||
|
||||
|
||||
@library.global_function
|
||||
@jinja2.pass_context
|
||||
def firefox_adjust_url(ctx, redirect, adgroup, creative=None):
|
||||
"""
|
||||
Return an adjust.com link for Firefox on mobile.
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
In Template
|
||||
-----------
|
||||
|
||||
{{ firefox_adjust_url('ios', 'accounts-page') }}
|
||||
"""
|
||||
adjust_url = settings.ADJUST_FIREFOX_URL
|
||||
app_store_url = settings.APPLE_APPSTORE_FIREFOX_LINK
|
||||
play_store_url = settings.GOOGLE_PLAY_FIREFOX_LINK
|
||||
locale = getattr(ctx["request"], "locale", "en-US")
|
||||
|
||||
return _get_adjust_link(adjust_url, app_store_url, play_store_url, redirect, locale, "firefox_mobile", adgroup, creative)
|
||||
|
||||
|
||||
@library.global_function
|
||||
@jinja2.pass_context
|
||||
def focus_adjust_url(ctx, redirect, adgroup, creative=None):
|
||||
"""
|
||||
Return an adjust.com link for Focus/Klar on mobile.
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
In Template
|
||||
-----------
|
||||
|
||||
{{ focus_adjust_url('ios', 'fights-for-you-page') }}
|
||||
"""
|
||||
klar_locales = ["de"]
|
||||
adjust_url = settings.ADJUST_FOCUS_URL
|
||||
app_store_url = settings.APPLE_APPSTORE_FOCUS_LINK
|
||||
play_store_url = settings.GOOGLE_PLAY_FOCUS_LINK
|
||||
locale = getattr(ctx["request"], "locale", "en-US")
|
||||
product = "focus"
|
||||
|
||||
if locale in klar_locales:
|
||||
adjust_url = settings.ADJUST_KLAR_URL
|
||||
app_store_url = settings.APPLE_APPSTORE_KLAR_LINK
|
||||
play_store_url = settings.GOOGLE_PLAY_KLAR_LINK
|
||||
product = "klar"
|
||||
|
||||
return _get_adjust_link(adjust_url, app_store_url, play_store_url, redirect, locale, product, adgroup, creative)
|
||||
|
||||
|
||||
@library.global_function
|
||||
@jinja2.pass_context
|
||||
def pocket_adjust_url(ctx, redirect, adgroup, creative=None):
|
||||
"""
|
||||
Return an adjust.com link for Pocket on mobile.
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
In Template
|
||||
-----------
|
||||
|
||||
{{ pocket_adjust_url('ios', 'accounts-page') }}
|
||||
"""
|
||||
adjust_url = settings.ADJUST_POCKET_URL
|
||||
app_store_url = settings.APPLE_APPSTORE_POCKET_LINK
|
||||
play_store_url = settings.GOOGLE_PLAY_POCKET_LINK
|
||||
locale = getattr(ctx["request"], "locale", "en-US")
|
||||
|
||||
return _get_adjust_link(adjust_url, app_store_url, play_store_url, redirect, locale, "pocket", adgroup, creative)
|
||||
|
||||
|
||||
@library.global_function
|
||||
@jinja2.pass_context
|
||||
def lockwise_adjust_url(ctx, redirect, adgroup, creative=None):
|
||||
"""
|
||||
Return an adjust.com link for Lockwise on mobile.
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
In Template
|
||||
-----------
|
||||
|
||||
{{ lockwise_adjust_url('ios', 'accounts-page') }}
|
||||
"""
|
||||
adjust_url = settings.ADJUST_LOCKWISE_URL
|
||||
app_store_url = settings.APPLE_APPSTORE_LOCKWISE_LINK
|
||||
play_store_url = settings.GOOGLE_PLAY_LOCKWISE_LINK
|
||||
locale = getattr(ctx["request"], "locale", "en-US")
|
||||
|
||||
return _get_adjust_link(adjust_url, app_store_url, play_store_url, redirect, locale, "lockwise", adgroup, creative)
|
||||
|
||||
|
||||
def _fxa_product_url(product_url, entrypoint, optional_parameters=None):
|
||||
separator = "&" if "?" in product_url else "?"
|
||||
url = f"{product_url}{separator}entrypoint={entrypoint}&form_type=button&utm_source={entrypoint}&utm_medium=referral"
|
||||
|
|
|
@ -663,40 +663,6 @@ class TestAbsoluteURLFilter(TestCase):
|
|||
assert misc.absolute_url("https://www.mozilla.org/en-US/firefox/new/") == expected
|
||||
|
||||
|
||||
class TestFirefoxIOSURL(TestCase):
|
||||
rf = RequestFactory()
|
||||
|
||||
def _render(self, locale, ct_param=None):
|
||||
req = self.rf.get("/")
|
||||
req.locale = locale
|
||||
|
||||
if ct_param:
|
||||
return render("{{ firefox_ios_url('%s') }}" % ct_param, {"request": req})
|
||||
|
||||
return render("{{ firefox_ios_url() }}", {"request": req})
|
||||
|
||||
def test_firefox_ios_url_no_locale(self):
|
||||
"""No locale, fallback to default URL"""
|
||||
assert self._render("") == "https://itunes.apple.com/app/firefox-private-safe-browser/id989804926"
|
||||
|
||||
def test_firefox_ios_url_default(self):
|
||||
"""should fallback to default URL"""
|
||||
assert self._render("ar") == "https://itunes.apple.com/app/firefox-private-safe-browser/id989804926"
|
||||
assert self._render("zu") == "https://itunes.apple.com/app/firefox-private-safe-browser/id989804926"
|
||||
|
||||
def test_firefox_ios_url_localized(self):
|
||||
"""should return localized URL"""
|
||||
assert self._render("en-US") == "https://itunes.apple.com/us/app/firefox-private-safe-browser/id989804926"
|
||||
assert self._render("es-ES") == "https://itunes.apple.com/es/app/firefox-private-safe-browser/id989804926"
|
||||
assert self._render("ja") == "https://itunes.apple.com/jp/app/firefox-private-safe-browser/id989804926"
|
||||
|
||||
def test_firefox_ios_url_param(self):
|
||||
"""should return default or localized URL with ct param"""
|
||||
assert self._render("", "mozorg") == ("https://itunes.apple.com/app/firefox-private-safe-browser/id989804926?ct=mozorg")
|
||||
assert self._render("en-US", "mozorg") == ("https://itunes.apple.com/us/app/firefox-private-safe-browser/id989804926?ct=mozorg")
|
||||
assert self._render("es-ES", "mozorg") == ("https://itunes.apple.com/es/app/firefox-private-safe-browser/id989804926?ct=mozorg")
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"html, cleaned",
|
||||
[
|
||||
|
@ -807,42 +773,140 @@ def test_csrf():
|
|||
class TestAppStoreURL(TestCase):
|
||||
rf = RequestFactory()
|
||||
|
||||
def _render(self, locale):
|
||||
def _render(self, product, campaign, locale):
|
||||
req = self.rf.get("/")
|
||||
req.locale = locale
|
||||
product = "lockwise"
|
||||
return render("{{ app_store_url('%s') }}" % product, {"request": req})
|
||||
return render(
|
||||
"{{{{ app_store_url('{0}', '{1}') }}}}".format(product, campaign),
|
||||
{"request": req},
|
||||
)
|
||||
|
||||
def test_app_store_url_no_locale(self):
|
||||
def test_firefox_app_store_url_no_locale(self):
|
||||
"""No locale, fallback to default URL"""
|
||||
assert self._render("") == "https://itunes.apple.com/app/id1314000270?mt=8"
|
||||
assert self._render("firefox", "", "") == "https://apps.apple.com/app/apple-store/id989804926"
|
||||
|
||||
def test_app_store_url_default(self):
|
||||
def test_firefox_app_store_url_default(self):
|
||||
"""should fallback to default URL"""
|
||||
assert self._render("ar") == "https://itunes.apple.com/app/id1314000270?mt=8"
|
||||
assert self._render("zu") == "https://itunes.apple.com/app/id1314000270?mt=8"
|
||||
assert self._render("firefox", "", "ar") == "https://apps.apple.com/app/apple-store/id989804926"
|
||||
assert self._render("firefox", "", "zu") == "https://apps.apple.com/app/apple-store/id989804926"
|
||||
|
||||
def test_app_store_url_localized(self):
|
||||
def test_firefox_app_store_url_localized(self):
|
||||
"""should return localized URL"""
|
||||
assert self._render("en-US") == "https://itunes.apple.com/us/app/id1314000270?mt=8"
|
||||
assert self._render("es-ES") == "https://itunes.apple.com/es/app/id1314000270?mt=8"
|
||||
assert self._render("de") == "https://itunes.apple.com/de/app/id1314000270?mt=8"
|
||||
assert self._render("firefox", "", "en-US") == "https://apps.apple.com/us/app/apple-store/id989804926"
|
||||
assert self._render("firefox", "", "es-ES") == "https://apps.apple.com/es/app/apple-store/id989804926"
|
||||
assert self._render("firefox", "", "de") == "https://apps.apple.com/de/app/apple-store/id989804926"
|
||||
|
||||
def test_firefox_app_store_url_localized_campaign(self):
|
||||
"""should return localized URL with additional campaign parameters"""
|
||||
assert (
|
||||
self._render("firefox", "firefox-home", "en-US")
|
||||
== "https://apps.apple.com/us/app/apple-store/id989804926?pt=373246&ct=firefox-home&mt=8"
|
||||
)
|
||||
assert (
|
||||
self._render("firefox", "firefox-home", "es-ES")
|
||||
== "https://apps.apple.com/es/app/apple-store/id989804926?pt=373246&ct=firefox-home&mt=8"
|
||||
)
|
||||
assert (
|
||||
self._render("firefox", "firefox-home", "de")
|
||||
== "https://apps.apple.com/de/app/apple-store/id989804926?pt=373246&ct=firefox-home&mt=8"
|
||||
)
|
||||
|
||||
def test_focus_app_store_url_localized_campaign(self):
|
||||
"""should return localized URL with additional campaign parameters"""
|
||||
assert (
|
||||
self._render("focus", "firefox-home", "en-US")
|
||||
== "https://apps.apple.com/us/app/apple-store/id1055677337?pt=373246&ct=firefox-home&mt=8"
|
||||
)
|
||||
assert (
|
||||
self._render("focus", "firefox-home", "es-ES")
|
||||
== "https://apps.apple.com/es/app/apple-store/id1055677337?pt=373246&ct=firefox-home&mt=8"
|
||||
)
|
||||
assert (
|
||||
self._render("focus", "firefox-home", "de")
|
||||
== "https://apps.apple.com/de/app/apple-store/id1073435754?pt=373246&ct=firefox-home&mt=8"
|
||||
)
|
||||
|
||||
def test_pocket_app_store_url_localized_campaign(self):
|
||||
"""should return localized URL with additional campaign parameters"""
|
||||
assert (
|
||||
self._render("pocket", "firefox-home", "en-US")
|
||||
== "https://apps.apple.com/us/app/apple-store/id309601447?pt=373246&ct=firefox-home&mt=8"
|
||||
)
|
||||
assert (
|
||||
self._render("pocket", "firefox-home", "es-ES")
|
||||
== "https://apps.apple.com/es/app/apple-store/id309601447?pt=373246&ct=firefox-home&mt=8"
|
||||
)
|
||||
assert (
|
||||
self._render("pocket", "firefox-home", "de")
|
||||
== "https://apps.apple.com/de/app/apple-store/id309601447?pt=373246&ct=firefox-home&mt=8"
|
||||
)
|
||||
|
||||
|
||||
class TestPlayStoreURL(TestCase):
|
||||
rf = RequestFactory()
|
||||
|
||||
def _render(self, locale):
|
||||
def _render(self, product, campaign, locale):
|
||||
req = self.rf.get("/")
|
||||
req.locale = locale
|
||||
product = "lockwise"
|
||||
return render("{{ play_store_url('%s') }}" % product, {"request": req})
|
||||
return render(
|
||||
"{{{{ play_store_url('{0}', '{1}') }}}}".format(product, campaign),
|
||||
{"request": req},
|
||||
)
|
||||
|
||||
def test_play_store_url_localized(self):
|
||||
def test_firefox_play_store_url_no_locale(self):
|
||||
"""No locale, fallback to default URL"""
|
||||
assert self._render("firefox", "", "") == "https://play.google.com/store/apps/details?id=org.mozilla.firefox"
|
||||
|
||||
def test_firefox_play_store_url_localized(self):
|
||||
"""should return localized URL"""
|
||||
assert self._render("en-US") == "https://play.google.com/store/apps/details?id=mozilla.lockbox&hl=en"
|
||||
assert self._render("es-ES") == "https://play.google.com/store/apps/details?id=mozilla.lockbox&hl=es"
|
||||
assert self._render("de") == "https://play.google.com/store/apps/details?id=mozilla.lockbox&hl=de"
|
||||
assert self._render("firefox", "", "en-US") == "https://play.google.com/store/apps/details?id=org.mozilla.firefox&hl=en"
|
||||
assert self._render("firefox", "", "es-ES") == "https://play.google.com/store/apps/details?id=org.mozilla.firefox&hl=es"
|
||||
assert self._render("firefox", "", "de") == "https://play.google.com/store/apps/details?id=org.mozilla.firefox&hl=de"
|
||||
|
||||
def test_firefox_play_store_url_localized_campaign(self):
|
||||
"""should return localized URL with additional campaign parameters"""
|
||||
assert (
|
||||
self._render("firefox", "firefox-home", "en-US")
|
||||
== "https://play.google.com/store/apps/details?id=org.mozilla.firefox&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=en"
|
||||
)
|
||||
assert (
|
||||
self._render("firefox", "firefox-home", "es-ES")
|
||||
== "https://play.google.com/store/apps/details?id=org.mozilla.firefox&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=es"
|
||||
)
|
||||
assert (
|
||||
self._render("firefox", "firefox-home", "de")
|
||||
== "https://play.google.com/store/apps/details?id=org.mozilla.firefox&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=de"
|
||||
)
|
||||
|
||||
def test_focus_play_store_url_localized_campaign(self):
|
||||
"""should return localized URL with additional campaign parameters"""
|
||||
assert (
|
||||
self._render("focus", "firefox-home", "en-US")
|
||||
== "https://play.google.com/store/apps/details?id=org.mozilla.focus&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=en"
|
||||
)
|
||||
assert (
|
||||
self._render("focus", "firefox-home", "es-ES")
|
||||
== "https://play.google.com/store/apps/details?id=org.mozilla.focus&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=es"
|
||||
)
|
||||
assert (
|
||||
self._render("focus", "firefox-home", "de")
|
||||
== "https://play.google.com/store/apps/details?id=org.mozilla.klar&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=de"
|
||||
)
|
||||
|
||||
def test_pocket_play_store_url_localized_campaign(self):
|
||||
"""should return localized URL with additional campaign parameters"""
|
||||
assert (
|
||||
self._render("pocket", "firefox-home", "en-US")
|
||||
== "https://play.google.com/store/apps/details?id=com.ideashower.readitlater.pro&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=en"
|
||||
)
|
||||
assert (
|
||||
self._render("pocket", "firefox-home", "es-ES")
|
||||
== "https://play.google.com/store/apps/details?id=com.ideashower.readitlater.pro&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=es"
|
||||
)
|
||||
assert (
|
||||
self._render("pocket", "firefox-home", "de")
|
||||
== "https://play.google.com/store/apps/details?id=com.ideashower.readitlater.pro&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=de"
|
||||
)
|
||||
|
||||
|
||||
class TestLangShort(TestCase):
|
||||
|
@ -881,230 +945,6 @@ class TestNativeLanguageName(TestCase):
|
|||
assert self._render("aaa") == "aaa"
|
||||
|
||||
|
||||
class TestFirefoxAdjustUrl(TestCase):
|
||||
rf = RequestFactory()
|
||||
|
||||
def _render(self, locale, redirect, adgroup, creative=None):
|
||||
req = self.rf.get("/")
|
||||
req.locale = locale
|
||||
|
||||
if creative:
|
||||
return render(f"{{{{ firefox_adjust_url('{redirect}', '{adgroup}', '{creative}') }}}}", {"request": req})
|
||||
|
||||
return render(f"{{{{ firefox_adjust_url('{redirect}', '{adgroup}') }}}}", {"request": req})
|
||||
|
||||
def test_firefox_ios_adjust_url(self):
|
||||
"""Firefox for mobile with an App Store URL redirect"""
|
||||
assert (
|
||||
self._render("en-US", "ios", "test-page") == "https://app.adjust.com/2uo1qc?redirect="
|
||||
"https%3A%2F%2Fitunes.apple.com%2Fus%2Fapp%2Ffirefox-private-safe-browser%2Fid989804926"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=firefox_mobile&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_firefox_ios_adjust_url_invalid_country(self):
|
||||
"""Firefox for mobile with an App Store URL redirect with an unsupported country"""
|
||||
assert (
|
||||
self._render("zz", "ios", "test-page") == "https://app.adjust.com/2uo1qc?redirect="
|
||||
"https%3A%2F%2Fitunes.apple.com%2Fapp%2Ffirefox-private-safe-browser%2Fid989804926"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=firefox_mobile&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_firefox_ios_adjust_url_creative(self):
|
||||
"""Firefox for mobile with an App Store URL redirect and creative param"""
|
||||
assert (
|
||||
self._render("de", "ios", "test-page", "experiment-name") == "https://app.adjust.com/2uo1qc?redirect="
|
||||
"https%3A%2F%2Fitunes.apple.com%2Fde%2Fapp%2Ffirefox-private-safe-browser%2Fid989804926"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&creative=experiment-name&mz_pr=firefox_mobile&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_firefox_android_adjust_url(self):
|
||||
"""Firefox for mobile with a Play Store redirect"""
|
||||
assert (
|
||||
self._render("en-US", "android", "test-page") == "https://app.adjust.com/2uo1qc?redirect="
|
||||
"https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dorg.mozilla.firefox"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=firefox_mobile&mz_pl=android"
|
||||
)
|
||||
|
||||
def test_firefox_no_redirect_adjust_url(self):
|
||||
"""Firefox for mobile with no redirect"""
|
||||
assert (
|
||||
self._render("en-US", None, "test-page") == "https://app.adjust.com/2uo1qc?"
|
||||
"campaign=www.mozilla.org&adgroup=test-page&mz_pr=firefox_mobile"
|
||||
)
|
||||
|
||||
|
||||
class TestFocusAdjustUrl(TestCase):
|
||||
rf = RequestFactory()
|
||||
|
||||
def _render(self, locale, redirect, adgroup, creative=None):
|
||||
req = self.rf.get("/")
|
||||
req.locale = locale
|
||||
|
||||
if creative:
|
||||
return render(f"{{{{ focus_adjust_url('{redirect}', '{adgroup}', '{creative}') }}}}", {"request": req})
|
||||
|
||||
return render(f"{{{{ focus_adjust_url('{redirect}', '{adgroup}') }}}}", {"request": req})
|
||||
|
||||
def test_focus_ios_adjust_url(self):
|
||||
"""Firefox Focus with an App Store URL redirect"""
|
||||
assert (
|
||||
self._render("en-US", "ios", "test-page") == "https://app.adjust.com/b8s7qo?redirect="
|
||||
"https%3A%2F%2Fitunes.apple.com%2Fus%2Fapp%2Ffirefox-focus-privacy-browser%2Fid1055677337"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=focus&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_focus_ios_adjust_url_invalid_country(self):
|
||||
"""Firefox Focus with an App Store URL redirect with an unsupported country"""
|
||||
assert (
|
||||
self._render("zz", "ios", "test-page") == "https://app.adjust.com/b8s7qo?redirect="
|
||||
"https%3A%2F%2Fitunes.apple.com%2Fapp%2Ffirefox-focus-privacy-browser%2Fid1055677337"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=focus&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_focus_ios_adjust_url_creative(self):
|
||||
"""Firefox Focus with an App Store URL redirect and creative param"""
|
||||
assert (
|
||||
self._render("fr", "ios", "test-page", "experiment-name") == "https://app.adjust.com/b8s7qo?"
|
||||
"redirect=https%3A%2F%2Fitunes.apple.com%2Ffr%2Fapp%2Ffirefox-focus-privacy-browser%2Fid1055677337"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&creative=experiment-name&mz_pr=focus&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_focus_android_adjust_url(self):
|
||||
"""Firefox Focus for mobile with a Play Store redirect"""
|
||||
assert (
|
||||
self._render("en-US", "android", "test-page") == "https://app.adjust.com/b8s7qo?redirect="
|
||||
"https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dorg.mozilla.focus"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=focus&mz_pl=android"
|
||||
)
|
||||
|
||||
def test_focus_no_redirect_adjust_url(self):
|
||||
"""Firefox Focus for mobile with no redirect"""
|
||||
assert (
|
||||
self._render("en-US", None, "test-page") == "https://app.adjust.com/b8s7qo?"
|
||||
"campaign=www.mozilla.org&adgroup=test-page&mz_pr=focus"
|
||||
)
|
||||
|
||||
def test_klar_ios_adjust_url(self):
|
||||
"""Firefox Klar with an App Store URL redirect"""
|
||||
assert (
|
||||
self._render("de", "ios", "test-page") == "https://app.adjust.com/jfcx5x?redirect="
|
||||
"https%3A%2F%2Fitunes.apple.com%2Fde%2Fapp%2Fklar-by-firefox%2Fid1073435754"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=klar&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_klar_android_adjust_url(self):
|
||||
"""Firefox Klar for mobile with a Play Store redirect"""
|
||||
assert (
|
||||
self._render("de", "android", "test-page") == "https://app.adjust.com/jfcx5x?redirect="
|
||||
"https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dorg.mozilla.klar"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=klar&mz_pl=android"
|
||||
)
|
||||
|
||||
|
||||
class TestLockwiseAdjustUrl(TestCase):
|
||||
rf = RequestFactory()
|
||||
|
||||
def _render(self, locale, redirect, adgroup, creative=None):
|
||||
req = self.rf.get("/")
|
||||
req.locale = locale
|
||||
|
||||
if creative:
|
||||
return render(f"{{{{ lockwise_adjust_url('{redirect}', '{adgroup}', '{creative}') }}}}", {"request": req})
|
||||
|
||||
return render(f"{{{{ lockwise_adjust_url('{redirect}', '{adgroup}') }}}}", {"request": req})
|
||||
|
||||
def test_lockwise_ios_adjust_url(self):
|
||||
"""Firefox Lockwise for mobile with an App Store URL redirect"""
|
||||
assert (
|
||||
self._render("en-US", "ios", "test-page") == "https://app.adjust.com/6tteyjo?redirect="
|
||||
"https%3A%2F%2Fitunes.apple.com%2Fus%2Fapp%2Fid1314000270%3Fmt%3D8"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=lockwise&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_lockwise_ios_adjust_url_invalid_country(self):
|
||||
"""Firefox Lockwise for mobile with an App Store URL redirect with an unsupported country"""
|
||||
assert (
|
||||
self._render("zz", "ios", "test-page") == "https://app.adjust.com/6tteyjo?redirect="
|
||||
"https%3A%2F%2Fitunes.apple.com%2Fapp%2Fid1314000270%3Fmt%3D8"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=lockwise&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_lockwise_ios_adjust_url_creative(self):
|
||||
"""Firefox Lockwise for mobile with an App Store URL redirect and creative param"""
|
||||
assert (
|
||||
self._render("de", "ios", "test-page", "experiment-name") == "https://app.adjust.com/6tteyjo"
|
||||
"?redirect=https%3A%2F%2Fitunes.apple.com%2Fde%2Fapp%2Fid1314000270%3Fmt%3D8"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&creative=experiment-name&mz_pr=lockwise&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_lockwise_android_adjust_url(self):
|
||||
"""Firefox Lockwise for mobile with a Play Store redirect"""
|
||||
assert (
|
||||
self._render("en-US", "android", "test-page") == "https://app.adjust.com/6tteyjo?redirect="
|
||||
"https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dmozilla.lockbox"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=lockwise&mz_pl=android"
|
||||
)
|
||||
|
||||
def test_lockwise_no_redirect_adjust_url(self):
|
||||
"""Firefox Lockwise for mobile with no redirect"""
|
||||
assert (
|
||||
self._render("en-US", None, "test-page") == "https://app.adjust.com/6tteyjo?"
|
||||
"campaign=www.mozilla.org&adgroup=test-page&mz_pr=lockwise"
|
||||
)
|
||||
|
||||
|
||||
class TestPocketAdjustUrl(TestCase):
|
||||
rf = RequestFactory()
|
||||
|
||||
def _render(self, locale, redirect, adgroup, creative=None):
|
||||
req = self.rf.get("/")
|
||||
req.locale = locale
|
||||
|
||||
if creative:
|
||||
return render(f"{{{{ pocket_adjust_url('{redirect}', '{adgroup}', '{creative}') }}}}", {"request": req})
|
||||
|
||||
return render(f"{{{{ pocket_adjust_url('{redirect}', '{adgroup}') }}}}", {"request": req})
|
||||
|
||||
def test_pocket_ios_adjust_url(self):
|
||||
"""Pocket for mobile with an App Store URL redirect"""
|
||||
assert (
|
||||
self._render("en-US", "ios", "test-page") == "https://app.adjust.com/m54twk?redirect="
|
||||
"https%3A%2F%2Fitunes.apple.com%2Fus%2Fapp%2Fpocket-save-read-grow%2Fid309601447"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=pocket&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_pocket_ios_adjust_url_invalid_country(self):
|
||||
"""Pocket for mobile with an App Store URL redirect with an unsupported country"""
|
||||
assert (
|
||||
self._render("zz", "ios", "test-page") == "https://app.adjust.com/m54twk?redirect="
|
||||
"https%3A%2F%2Fitunes.apple.com%2Fapp%2Fpocket-save-read-grow%2Fid309601447"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=pocket&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_pocket_ios_adjust_url_creative(self):
|
||||
"""Pocket for mobile with an App Store URL redirect and creative param"""
|
||||
assert (
|
||||
self._render("de", "ios", "test-page", "experiment-name") == "https://app.adjust.com/m54twk?redirect="
|
||||
"https%3A%2F%2Fitunes.apple.com%2Fde%2Fapp%2Fpocket-save-read-grow%2Fid309601447"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&creative=experiment-name&mz_pr=pocket&mz_pl=ios"
|
||||
)
|
||||
|
||||
def test_pocket_android_adjust_url(self):
|
||||
"""Pocket for mobile with a Play Store redirect"""
|
||||
assert (
|
||||
self._render("en-US", "android", "test-page") == "https://app.adjust.com/m54twk?redirect="
|
||||
"https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.ideashower.readitlater.pro"
|
||||
"&campaign=www.mozilla.org&adgroup=test-page&mz_pr=pocket&mz_pl=android"
|
||||
)
|
||||
|
||||
def test_pocket_no_redirect_adjust_url(self):
|
||||
"""Pocket for mobile with no redirect"""
|
||||
assert (
|
||||
self._render("en-US", None, "test-page") == "https://app.adjust.com/m54twk?"
|
||||
"campaign=www.mozilla.org&adgroup=test-page&mz_pr=pocket"
|
||||
)
|
||||
|
||||
|
||||
@override_settings(FXA_ENDPOINT=TEST_FXA_ENDPOINT)
|
||||
@override_settings(RELAY_PRODUCT_URL="https://relay.firefox.com/")
|
||||
class TestRelayFxAButton(TestCase):
|
||||
|
|
|
@ -16,9 +16,8 @@ GOOGLE_PLAY_FIREFOX_LINK_UTMS = GOOGLE_PLAY_FIREFOX_LINK + "&referrer=" + quote(
|
|||
# Bug 1264843, Issue 13108: link to China build of Fx4A, for display within Fx China repack
|
||||
GOOGLE_PLAY_FIREFOX_LINK_MOZILLAONLINE = "https://www.firefox.com.cn/mobile/get-app/"
|
||||
|
||||
# Link to Firefox for iOS on the Apple App Store with Google Analytics campaign
|
||||
# patameters. Each implementation should add a "ct" parameter for analytics.
|
||||
APPLE_APPSTORE_FIREFOX_LINK = "https://itunes.apple.com/{country}/app/firefox-private-safe-browser/id989804926"
|
||||
# Link to Firefox for iOS on the Apple App Store.
|
||||
APPLE_APPSTORE_FIREFOX_LINK = "https://apps.apple.com/{country}/app/apple-store/id989804926"
|
||||
|
||||
# Map Mozilla's locale codes to Apple's country codes so we can link to a
|
||||
# localized App Store page when possible. Here's the official territory list:
|
||||
|
@ -81,29 +80,23 @@ APPLE_APPSTORE_COUNTRY_MAP = {
|
|||
}
|
||||
|
||||
# Link to Firefox Focus on the Apple App Store.
|
||||
APPLE_APPSTORE_FOCUS_LINK = "https://itunes.apple.com/{country}/app/firefox-focus-privacy-browser/id1055677337"
|
||||
APPLE_APPSTORE_FOCUS_LINK = "https://apps.apple.com/{country}/app/apple-store/id1055677337"
|
||||
|
||||
# Link to Firefox Focus on the Google Play store.
|
||||
GOOGLE_PLAY_FOCUS_LINK = "https://play.google.com/store/apps/details?id=org.mozilla.focus"
|
||||
|
||||
# Link to Firefox Focus on the Apple App Store.
|
||||
APPLE_APPSTORE_KLAR_LINK = "https://itunes.apple.com/{country}/app/klar-by-firefox/id1073435754"
|
||||
APPLE_APPSTORE_KLAR_LINK = "https://apps.apple.com/{country}/app/apple-store/id1073435754"
|
||||
|
||||
# Link to Firefox Klar on the Google Play store.
|
||||
GOOGLE_PLAY_KLAR_LINK = "https://play.google.com/store/apps/details?id=org.mozilla.klar"
|
||||
|
||||
# Link to Pocket on the Apple App Store.
|
||||
APPLE_APPSTORE_POCKET_LINK = "https://itunes.apple.com/{country}/app/pocket-save-read-grow/id309601447"
|
||||
APPLE_APPSTORE_POCKET_LINK = "https://apps.apple.com/{country}/app/apple-store/id309601447"
|
||||
|
||||
# Link to Pocket on the Google Play store.
|
||||
GOOGLE_PLAY_POCKET_LINK = "https://play.google.com/store/apps/details?id=com.ideashower.readitlater.pro"
|
||||
|
||||
# Link to Lockwise on the Apple App Store.
|
||||
APPLE_APPSTORE_LOCKWISE_LINK = "https://itunes.apple.com/{country}/app/id1314000270?mt=8"
|
||||
|
||||
# Link to Lockwise on the Google Play store.
|
||||
GOOGLE_PLAY_LOCKWISE_LINK = "https://play.google.com/store/apps/details?id=mozilla.lockbox"
|
||||
|
||||
# Link to Firefox Beta on the Google Play Store.
|
||||
GOOGLE_PLAY_FIREFOX_BETA_LINK = "https://play.google.com/store/apps/details?id=org.mozilla.firefox_beta"
|
||||
|
||||
|
@ -115,10 +108,3 @@ AMAZON_FIREFOX_FIRE_TV_LINK = "https://www.amazon.com/Mozilla-Firefox-for-Fire-T
|
|||
|
||||
# Link to Firefox Send on the Google Play Store.
|
||||
GOOGLE_PLAY_FIREFOX_SEND_LINK = "https://play.google.com/store/apps/details?id=org.mozilla.firefoxsend"
|
||||
|
||||
# app.adjust.com links for all of the above products (Issue 7214)
|
||||
ADJUST_FIREFOX_URL = "https://app.adjust.com/2uo1qc"
|
||||
ADJUST_FOCUS_URL = "https://app.adjust.com/b8s7qo"
|
||||
ADJUST_KLAR_URL = "https://app.adjust.com/jfcx5x"
|
||||
ADJUST_POCKET_URL = "https://app.adjust.com/m54twk"
|
||||
ADJUST_LOCKWISE_URL = "https://app.adjust.com/6tteyjo"
|
||||
|
|
|
@ -922,17 +922,11 @@ CJMS_AFFILIATE_ENDPOINT = "https://stage.cjms.nonprod.cloudops.mozgcp.net/aic" i
|
|||
|
||||
# Google Play and Apple App Store settings
|
||||
from .appstores import ( # noqa: E402, F401
|
||||
ADJUST_FIREFOX_URL,
|
||||
ADJUST_FOCUS_URL,
|
||||
ADJUST_KLAR_URL,
|
||||
ADJUST_LOCKWISE_URL,
|
||||
ADJUST_POCKET_URL,
|
||||
AMAZON_FIREFOX_FIRE_TV_LINK,
|
||||
APPLE_APPSTORE_COUNTRY_MAP,
|
||||
APPLE_APPSTORE_FIREFOX_LINK,
|
||||
APPLE_APPSTORE_FOCUS_LINK,
|
||||
APPLE_APPSTORE_KLAR_LINK,
|
||||
APPLE_APPSTORE_LOCKWISE_LINK,
|
||||
APPLE_APPSTORE_POCKET_LINK,
|
||||
GOOGLE_PLAY_FIREFOX_BETA_LINK,
|
||||
GOOGLE_PLAY_FIREFOX_LINK,
|
||||
|
@ -942,7 +936,6 @@ from .appstores import ( # noqa: E402, F401
|
|||
GOOGLE_PLAY_FIREFOX_SEND_LINK,
|
||||
GOOGLE_PLAY_FOCUS_LINK,
|
||||
GOOGLE_PLAY_KLAR_LINK,
|
||||
GOOGLE_PLAY_LOCKWISE_LINK,
|
||||
GOOGLE_PLAY_POCKET_LINK,
|
||||
)
|
||||
|
||||
|
|
|
@ -8,26 +8,40 @@
|
|||
Firefox mobile attribution
|
||||
==========================
|
||||
|
||||
For Firefox mobile app store referrals we use `Adjust`_, a third-party
|
||||
attribution system for mobile apps that is designed to measure, optimize
|
||||
and scale app growth. We use Adjust tracking links across www.mozilla.org
|
||||
when we link to app stores for both Firefox and Firefox Focus on Android
|
||||
and iOS. We also often embed Adjust links in QR codes that we display to
|
||||
desktop visitors.
|
||||
For Firefox mobile referrals we use native app store web links with additional
|
||||
campaign parameters to help measure download to install rates.
|
||||
|
||||
To find out more about Adjust, see the following links:
|
||||
App store url helpers
|
||||
---------------------
|
||||
|
||||
- `What is mobile ad attribution?`_
|
||||
- `Attribution methods`_
|
||||
To help streamline creating app store referral links we have `app_store_url()` and
|
||||
`play_store_url()` helpers, which accept a `product`` name and an optional
|
||||
`campaign`` parameter.
|
||||
|
||||
Adjust link helpers
|
||||
-------------------
|
||||
For example:
|
||||
|
||||
Whilst they are not used routinely in our pages, bedrock does have a series
|
||||
of `Adjust link helpers`_ that can be used to create Adjust links for different
|
||||
products.
|
||||
```
|
||||
play_store_url('firefox', 'firefox-home')
|
||||
app_store_url('firefox', 'firefox-home')
|
||||
```
|
||||
|
||||
.. _Adjust: https://www.adjust.com/
|
||||
.. _What is mobile ad attribution?: https://www.adjust.com/blog/mobile-ad-attribution-introduction-for-beginners/
|
||||
.. _Attribution methods: https://help.adjust.com/en/article/attribution-methods
|
||||
.. _Adjust link helpers: https://github.com/mozilla/bedrock/blob/main/bedrock/mozorg/templatetags/misc.py
|
||||
Would render:
|
||||
|
||||
```
|
||||
https://apps.apple.com/us/app/apple-store/id989804926?pt=373246&ct=firefox-home&mt=8
|
||||
https://play.google.com/store/apps/details?id=org.mozilla.firefox&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=en
|
||||
```
|
||||
|
||||
For Firefox Focus:
|
||||
|
||||
```
|
||||
play_store_url('focus', 'firefox-browsers-mobile-focus')
|
||||
app_store_url('focus', 'firefox-browsers-mobile-focus')
|
||||
```
|
||||
|
||||
Would render:
|
||||
|
||||
```
|
||||
https://apps.apple.com/us/app/apple-store/id1055677337?pt=373246&ct=firefox-home&mt=8
|
||||
https://play.google.com/store/apps/details?id=org.mozilla.focus&referrer=utm_source%3Dwww.mozilla.org%26utm_medium%3Dreferral%26utm_campaign%3Dfirefox-home&hl=en
|
||||
```
|
||||
|
|
|
@ -12,7 +12,6 @@ const iTunesURL = /^https:\/\/itunes.apple.com/;
|
|||
const appStoreURL = /^https:\/\/apps.apple.com/;
|
||||
const playStoreURL = /^https:\/\/play.google.com/;
|
||||
const marketURL = /^market:\/\/play.google.com/;
|
||||
const adjustURL = /^https:\/\/app.adjust.com/;
|
||||
|
||||
if (typeof window.dataLayer === 'undefined') {
|
||||
window.dataLayer = [];
|
||||
|
@ -32,8 +31,7 @@ TrackProductDownload.isValidDownloadURL = (downloadURL) => {
|
|||
iTunesURL.test(downloadURL) ||
|
||||
appStoreURL.test(downloadURL) ||
|
||||
playStoreURL.test(downloadURL) ||
|
||||
marketURL.test(downloadURL) ||
|
||||
adjustURL.test(downloadURL)
|
||||
marketURL.test(downloadURL)
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -184,15 +182,6 @@ TrackProductDownload.getEventFromUrl = (downloadURL) => {
|
|||
'store',
|
||||
'release'
|
||||
);
|
||||
} else if (adjustURL.test(downloadURL)) {
|
||||
const adjustProduct = params.mz_pr ? params.mz_pr : 'unrecognized';
|
||||
const adjustPlatform = params.mz_pl ? params.mz_pl : '';
|
||||
eventObject = TrackProductDownload.getEventObject(
|
||||
adjustProduct,
|
||||
adjustPlatform,
|
||||
'adjust',
|
||||
'release'
|
||||
);
|
||||
}
|
||||
|
||||
return eventObject;
|
||||
|
|
|
@ -48,12 +48,6 @@ describe('TrackProductDownload.isValidDownloadURL', function () {
|
|||
);
|
||||
expect(testPlayStoreURL).toBe(true);
|
||||
});
|
||||
it('should recognize Adjust as a valid URL', function () {
|
||||
let testAdjustURL = TrackProductDownload.isValidDownloadURL(
|
||||
'https://app.adjust.com/2uo1qc?redirect=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dorg.mozilla.firefox&campaign=www.mozilla.org&adgroup=mobile-android-page'
|
||||
);
|
||||
expect(testAdjustURL).toBe(true);
|
||||
});
|
||||
it('should not accept a random link to mozilla.org as a valid URL', function () {
|
||||
let testRandomURL = TrackProductDownload.isValidDownloadURL(
|
||||
'https://www.mozilla.org/en-US/firefox/all/'
|
||||
|
@ -117,12 +111,6 @@ describe('TrackProductDownload.getEventFromUrl', function () {
|
|||
);
|
||||
expect(testEvent['product']).toBe('firefox_mobile');
|
||||
});
|
||||
it('should identify product for Firefox with Adjust', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
'https://app.adjust.com/2uo1qc?mz_pr=firefox_mobile&mz_pl=mobile'
|
||||
);
|
||||
expect(testEvent['product']).toBe('firefox_mobile');
|
||||
});
|
||||
it('should identify product for Pocket in the App Store', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
'https://itunes.apple.com/{country}/app/pocket-save-read-grow/id309601447'
|
||||
|
@ -135,12 +123,6 @@ describe('TrackProductDownload.getEventFromUrl', function () {
|
|||
);
|
||||
expect(testEvent['product']).toBe('pocket');
|
||||
});
|
||||
it('should identify product for Pocket with Adjust', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
'https://app.adjust.com/m54twk?mz_pr=pocket&mz_pl=mobile'
|
||||
);
|
||||
expect(testEvent['product']).toBe('pocket');
|
||||
});
|
||||
it('should identify product for Focus in the App Store', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
'https://itunes.apple.com/{country}/app/firefox-focus-privacy-browser/id1055677337'
|
||||
|
@ -153,12 +135,6 @@ describe('TrackProductDownload.getEventFromUrl', function () {
|
|||
);
|
||||
expect(testEvent['product']).toBe('focus');
|
||||
});
|
||||
it('should identify product for Focus with Adjust', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
'https://app.adjust.com/b8s7qo?mz_pr=focus&mz_pl=android'
|
||||
);
|
||||
expect(testEvent['product']).toBe('focus');
|
||||
});
|
||||
it('should identify product for Klar in the App Store', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
'https://itunes.apple.com/{country}/app/klar-by-firefox/id1073435754'
|
||||
|
@ -171,12 +147,6 @@ describe('TrackProductDownload.getEventFromUrl', function () {
|
|||
);
|
||||
expect(testEvent['product']).toBe('klar');
|
||||
});
|
||||
it('should identify product for Klar with Adjust', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
'https://app.adjust.com/jfcx5x?mz_pr=klar&mz_pl=mobile'
|
||||
);
|
||||
expect(testEvent['product']).toBe('klar');
|
||||
});
|
||||
it('should identify product as unrecognized if App Store link is not found', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
'https://itunes.apple.com/us/app/49th-parallel-coffee-roasters/id1567407403'
|
||||
|
@ -232,24 +202,6 @@ describe('TrackProductDownload.getEventFromUrl', function () {
|
|||
);
|
||||
expect(testEvent['platform']).toBe('android');
|
||||
});
|
||||
it('should identify platform for Adjust link direct to Play Store', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
'https://app.adjust.com/b8s7qo?redirect=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dorg.mozilla.focus&campaign=www.mozilla.org&adgroup=mobile-focus-page&mz_pr=focus&mz_pl=android'
|
||||
);
|
||||
expect(testEvent['platform']).toBe('android');
|
||||
});
|
||||
it('should identify platform for Adjust link direct to App Store', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
'https://app.adjust.com/b8s7qo?redirect=https%3A%2F%2Fitunes.apple.com%2Fus%2Fapp%2Ffirefox-focus-privacy-browser%2Fid1055677337&campaign=www.mozilla.org&adgroup=mobile-focus-page&mz_pr=focus&mz_pl=ios'
|
||||
);
|
||||
expect(testEvent['platform']).toBe('ios');
|
||||
});
|
||||
it('should not identify platform for Adjust link without redirect', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
'https://app.adjust.com/b8s7qo'
|
||||
);
|
||||
expect(testEvent['platform']).toBe('');
|
||||
});
|
||||
// release channel
|
||||
it('should identify release_channel for Firefox Release', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
|
@ -342,12 +294,6 @@ describe('TrackProductDownload.getEventFromUrl', function () {
|
|||
);
|
||||
expect(testEvent['download_language']).toBeFalsy();
|
||||
});
|
||||
it('should not identify language for an Adjust link', function () {
|
||||
let testEvent = TrackProductDownload.getEventFromUrl(
|
||||
'https://app.adjust.com/2uo1qc?mz_pr=focus&mz_pl=android'
|
||||
);
|
||||
expect(testEvent['download_language']).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('TrackProductDownload.handleLink', function () {
|
||||
|
|
|
@ -429,7 +429,7 @@ describe('all-downloads-unified.js', function () {
|
|||
<h4 class="c-locale-label">Multiple languages</h4>
|
||||
<ul class="c-download-list">
|
||||
<li>
|
||||
<a id="playStoreLink-list" rel="external" href="https://app.adjust.com/2uo1qc?redirect=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dorg.mozilla.firefox&campaign=www.mozilla.org&adgroup=all-page" data-link-type="download" data-download-os="Android" data-mozillaonline-link="https://play.google.com/store/apps/details?id=cn.mozilla.firefox&referrer=utm_source%3Dmozilla%26utm_medium%3DReferral%26utm_campaign%3Dmozilla-org">
|
||||
<a id="playStoreLink-list" rel="external" href="https://play.google.com/store/apps/details?id=org.mozilla.firefox" data-link-type="download" data-download-os="Android" data-mozillaonline-link="https://play.google.com/store/apps/details?id=cn.mozilla.firefox&referrer=utm_source%3Dmozilla%26utm_medium%3DReferral%26utm_campaign%3Dmozilla-org">
|
||||
Google Play
|
||||
</a>
|
||||
</li>
|
||||
|
|
Загрузка…
Ссылка в новой задаче