Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ToS marketing opt out page (Fixes #15946) #15992

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

alexgibson
Copy link
Member

@alexgibson alexgibson commented Feb 13, 2025

One-line summary

  • Adds a custom Firefox landing page that will be used as a destination for people who click on ad links.
  • Also updates a couple of strings on /firefox/new/, at request of the product team.

Significant changes and points to review

The "opt-out" checkbox is effectively a full opt-out of analytics and attribution in general, using the same cookie as our consent banner / cookie settings page. The only new detail is that because it is "opt-out" and not "opt-in", when someone unchecks the input, we must "undo" things like removing attribution parameters from download links and removing the existing attribution cookie.

The checkbox will only appear if:

  • Visitors are outside of EU/EAA (e.g. they are in the US).
  • The do not have DNT / GPC enabled.
  • They have not already explicitly rejected analytics cookies (e.g. via the /privacy/websites/cookie-settings page, or unchecking the checkbox previously).

Issue / Bugzilla link

#15946

Testing

http://localhost:8000/en-US/firefox/landing/get/

@alexgibson alexgibson added the WMO and FXC Code relevant to both the WMO and FXC projects label Feb 13, 2025
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.57%. Comparing base (9257054) to head (dbf6d6d).
Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15992   +/-   ##
=======================================
  Coverage   79.57%   79.57%           
=======================================
  Files         160      160           
  Lines        8396     8396           
=======================================
  Hits         6681     6681           
  Misses       1715     1715           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alexgibson alexgibson added P2 Second level priority - Should have Needs Review Awaiting code review Review: S Code review time: 30 mins to 1 hour labels Feb 14, 2025
@alexgibson alexgibson marked this pull request as ready for review February 14, 2025 10:11
@alexgibson alexgibson requested review from a team as code owners February 14, 2025 10:11
@maureenlholland maureenlholland self-assigned this Feb 19, 2025
@maureenlholland maureenlholland removed the Needs Review Awaiting code review label Feb 19, 2025
Copy link
Collaborator

@maureenlholland maureenlholland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very minor question and nits on in-progress review


{% block canonical_urls %}<meta name="robots" content="noindex,follow">{% endblock %}

{% block experiments %}{% endblock %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (non-blocking): My understanding is that inheritance goes back from download to base to base-protocol, and the experiments block in base protocol is already empty. Why do we need to redeclare an empty block here and in the tech.html file?

Copy link
Member Author

@alexgibson alexgibson Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will basically ensure that if any experiments are run in firefox/new/desktop/download.html, overriding the block here will make it so the experiment won't also trigger on this custom page.

<label for="{{ id }}" class="marketing-opt-out-checkbox-label hidden">
<input type="checkbox" id="{{ id }}" class="marketing-opt-out-checkbox-input">
<span class="marketing-opt-out-text">
{% set attrs = 'href="https://support.mozilla.org/kb/marketing-data" target="_blank" rel="noopener"' %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (potentially blocking) I only see "Placeholder Bug 1933833" at this link. Is that going to be updated before this launches?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good call out, but I don't think this is a blocker. No traffic will go to this page until everything is ready.

Copy link
Collaborator

@maureenlholland maureenlholland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The built-in tests are excellent and the logic breaks down really cleanly 🥇

Successfully tested with:

  • geo US (show checkbox)
  • geo FR (no checkbox or attribution)
  • GPC setting on (no checkbox or attribution)
  • Previously rejected (no checkbox or attribution)
  • Chrome 133, Safari 18.1.1, Edge 132, Firefox 135
    • checking one checkbox checks them all
    • unchecking one checkbox unchecks them all
    • unchecking sets consent pref cookie
    • checking sets attribution cookies

The only blocking issue I have here is for IE 10/11 and it might just be misunderstanding of expectation. I see no checkbox to opt out of attribution (see comment). If it seems like this is a bug, we might need to check on an actual windows computer (I tested on browserstack, and none of my console logs showed up, don't know if the file wasn't running because of IE or browserstack)

{% if settings.STUB_ATTRIBUTION_RATE %}
{{ super() }}
<!--[if IE 9]><!-->
{# Ensure opt-out runs in IE 10 / 11 since we also support stub attribution for those browsers. #}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (blocking): I can see stub attribution data set on IE 10/11, but I don't see the opt out checkbox
ie-stub-cookies
ie-no-checkbox

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maureenlholland my guess is this is a problem with webpack's dev mode not working in IE on localhost.

I pushed this branch up to a demo here: https://www-demo1.allizom.org/en-US/firefox/landing/get/

It seems to work for me in IE 9/10 - care to give it a try there? thanks

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good instinct, demo link works for me 👍

Copy link
Collaborator

@maureenlholland maureenlholland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ ⚙️

@maureenlholland maureenlholland merged commit 5bdebe7 into mozilla:main Feb 20, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Second level priority - Should have Review: S Code review time: 30 mins to 1 hour WMO and FXC Code relevant to both the WMO and FXC projects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants