diff --git a/bedrock/products/templates/products/vpn/base.html b/bedrock/products/templates/products/vpn/base.html index 411544e8e69..7e48d85d702 100644 --- a/bedrock/products/templates/products/vpn/base.html +++ b/bedrock/products/templates/products/vpn/base.html @@ -12,6 +12,7 @@ {% block page_favicon %}{{ static('img/favicons/vpn/favicon.ico') }}{% endblock %} {% block page_favicon_large %}{{ static('img/favicons/vpn/favicon.png') }}{% endblock %} {% block page_ios_icon %}{{ static('img/favicons/vpn/favicon.png') }}{% endblock %} +{% block extra_meta %}{% endblock %} {% block sub_navigation %} {% include 'products/vpn/includes/subnav-refresh.html' %} diff --git a/bedrock/products/templates/products/vpn/landing-refresh.html b/bedrock/products/templates/products/vpn/landing-refresh.html index 5a5d3c1b366..94eed8cd262 100644 --- a/bedrock/products/templates/products/vpn/landing-refresh.html +++ b/bedrock/products/templates/products/vpn/landing-refresh.html @@ -8,6 +8,9 @@ {% from "products/vpn/includes/macros.html" import vpn_nav_cta_refresh, vpn_conditional_cta_refresh with context %} {% extends "products/vpn/base.html" %} +{% block extra_meta %} + +{% endblock %} {# Issue 13019: Avoid duplicate content for English pages. #} {%- block page_title_full -%} @@ -62,6 +65,8 @@ {% set headline_exp_v3_sub = 'Protect your digital activity and physical location with just one click.' %} {% endif %} +{% set show_vpn_ppa_exp = switch('experiment-vpn-ppa', ['en-US']) and country_code == "US" %} + {% block content %}
{% call split( @@ -407,4 +412,7 @@

{% endif %} {{ js_bundle('data_begincheckout') }} + {% if show_vpn_ppa_exp %} + {{ js_bundle('mozilla-vpn-ppa-experiment') }} + {% endif %} {% endblock %} diff --git a/media/js/products/vpn/ppa-experiment.js b/media/js/products/vpn/ppa-experiment.js new file mode 100644 index 00000000000..2287539b3ca --- /dev/null +++ b/media/js/products/vpn/ppa-experiment.js @@ -0,0 +1,23 @@ +/* + * 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/. + */ + +if (/\sFirefox/.test(navigator.userAgent)) { + const links = document.getElementsByClassName('js-fxa-product-button'); + Array.from(links).forEach((link) => { + 'use strict'; + + link.addEventListener('click', () => { + navigator.privateAttribution.measureConversion({ + task: 'task_id', // Unique task ID. Supplied by Mozilla. + histogramSize: 5, // Supplied by Mozilla + lookbackDays: 30, + impression: 'click', + ads: ['moz-mdn-test-2'], + sources: ['mozilla.org'] + }); + }); + }); +} diff --git a/media/static-bundles.json b/media/static-bundles.json index 8474f025f7d..300c2210185 100644 --- a/media/static-bundles.json +++ b/media/static-bundles.json @@ -1744,6 +1744,12 @@ ], "name": "mozilla-vpn-landing-headlines-experiment" }, + { + "files": [ + "js/products/vpn/ppa-experiment.js" + ], + "name": "mozilla-vpn-ppa-experiment" + }, { "files": [ "js/products/shared/affiliate-init.es6.js"