Skip to content

feat(cookie-control): add CCPA mode for California visitors#16157

Merged
mmmavis merged 17 commits into
feature/cookie-banner-civicfrom
TP1-4027-cookie-ccpa
Jul 14, 2026
Merged

feat(cookie-control): add CCPA mode for California visitors#16157
mmmavis merged 17 commits into
feature/cookie-banner-civicfrom
TP1-4027-cookie-ccpa

Conversation

@mmmavis

@mmmavis mmmavis commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds CCPA mode detection and localized text configuration for Civic Cookie Control.

  • Detects CCPA jurisdiction via Civic's geoTest response (withinCCPA)
  • Sets mode: "ccpa" automatically for California visitors, mode: "gdpr" everywhere else
  • Adds ccpaConfig per locale with "Do Not Sell or Share My Personal Information" as the reject button label
  • Overrides banner title and settings with the opt-out button label in CCPA mode via withCCPATitle() helper
  • Confirmed locally: "Do Not Sell" button revokes all optional cookies, same as GDPR reject

Related PRs/issues: Jira Ticket

To Test

Tip — clearing the consent cookie between tests: Open DevTools → Application tab → Cookies → select your localhost URL → find the CookieControl cookie and delete it. Then reload the page to see a fresh banner.

  1. Go to https://foundation-s-tp1-4027-c-6dircq.mofostaging.net
  2. Test GDPR mode (no VPN): banner should show with standard Accept/Reject buttons
  3. Test CCPA mode (California VPN): reload — banner title should change to "Do Not Sell or Share My Personal Information"; clicking it should revoke all optional cookies (verify via CookieControl cookie in DevTools — you may need to clear it manually between tests)
  4. Test localized text: change Firefox language setting (Preferences → General → Language) and reload — banner should display in the matching locale

@mmmavis mmmavis changed the title [WIP] feat(cookie-control): add CCPA mode detection and ccpaConfig scaffolding [WIP] feat(cookie-control): add CCPA mode for California visitors Jun 30, 2026
Base automatically changed from TP1-3992-civic-banner-styling to feature/cookie-banner-civic July 2, 2026 19:56
@mmmavis
mmmavis force-pushed the TP1-4027-cookie-ccpa branch from 842d84c to 508b704 Compare July 2, 2026 20:01
@mmmavis
mmmavis temporarily deployed to foundation-s-tp1-4027-c-6dircq July 3, 2026 20:16 Inactive
@mmmavis
mmmavis temporarily deployed to foundation-s-tp1-4027-c-6dircq July 6, 2026 22:28 Inactive
mmmavis added 2 commits July 6, 2026 15:39
…tSettings across all locales"

This reverts commit b68c923.
@mmmavis
mmmavis temporarily deployed to foundation-s-tp1-4027-c-6dircq July 6, 2026 22:53 Inactive
@mmmavis
mmmavis temporarily deployed to foundation-s-tp1-4027-c-6dircq July 6, 2026 22:55 Inactive
@mmmavis
mmmavis had a problem deploying to foundation-s-tp1-4027-c-6dircq July 6, 2026 23:21 Failure
mmmavis added 2 commits July 6, 2026 16:29
…glish

- Drop the [WIP] prefix from all localized closeLabel values; a TODO comment is left in place until proper translations are sourced.
- Move Polish (pl) out of CCPA_TITLE's inline object and into the English-fallback block alongside ca and fy, mirroring the pattern used for those locales.
- Replace the [WIP] Polish ccpaConfig description and name with the English text so the widget is functional rather than broken.
@mmmavis
mmmavis had a problem deploying to foundation-s-tp1-4027-c-6dircq July 6, 2026 23:36 Failure
… correct CCPA intro paragraph

The French ccpaConfig.description was set to a single opt-out statement instead of the full cookie policy intro paragraph. Replaced with the correct French CCPA text. Also reformatted the nl ccpaConfig.description to use a separate line for readability (no content change).
@mmmavis
mmmavis temporarily deployed to foundation-s-tp1-4027-c-6dircq July 6, 2026 23:43 Inactive
@mmmavis
mmmavis temporarily deployed to foundation-s-tp1-4027-c-6dircq July 6, 2026 23:52 Inactive
@mmmavis
mmmavis temporarily deployed to foundation-s-tp1-4027-c-6dircq July 7, 2026 00:03 Inactive
@mmmavis
mmmavis temporarily deployed to foundation-s-tp1-4027-c-6dircq July 7, 2026 04:21 Inactive
@mmmavis
mmmavis temporarily deployed to foundation-s-tp1-4027-c-6dircq July 7, 2026 04:54 Inactive
@mmmavis
mmmavis marked this pull request as ready for review July 7, 2026 16:56
@mmmavis
mmmavis temporarily deployed to foundation-s-tp1-4027-c-6dircq July 7, 2026 16:56 Inactive
@mergify

mergify Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mmmavis mmmavis changed the title [WIP] feat(cookie-control): add CCPA mode for California visitors feat(cookie-control): add CCPA mode for California visitors Jul 7, 2026
@mmmavis
mmmavis requested review from ramram-mf and simont-cr July 7, 2026 16:57
@ramram-mf
ramram-mf temporarily deployed to foundation-s-tp1-4027-c-cumax4 July 13, 2026 19:51 Inactive

@ramram-mf ramram-mf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM thanks @mmmavis !

@mmmavis
mmmavis merged commit 056a54b into feature/cookie-banner-civic Jul 14, 2026
11 checks passed
@mmmavis
mmmavis deleted the TP1-4027-cookie-ccpa branch July 14, 2026 16:21
mmmavis added a commit that referenced this pull request Jul 15, 2026
* feat: Civic cookie banner (styling, localized text, GTM Consent Mode v2 defaults) (#16128)

* basic Civic cookie banner set up & styling overrides

* feat: extract cookie consent localized text into separate module

* style: add a new color token & update styling for cookie banner

* feat: scaffold localized text for all supported cookie banner locales

* added another placeholder for optional cookie category

* fix formatting/linting issues

* feat: scaffold optional cookie categories with functional cookie list

* refactor: move cookie control JS files into civic_cookie_control/ folder

* docs: add COOKIE_CONTROL_API_KEY to README env vars

* feat: populate cookie lists for performance and personalized advertising categories

* feat: set gtag Consent Mode v2 defaults to denied before GTM loads

* styling fixes

* feat: enable consent logging for testing

* refactor: remove manual gtag consent callbacks as it will be handled by Civic GTM Template (TP1-3991)

* feat: scaffold optional cookie category text for all locales and add ES localized banner text

* feat: add FR localized banner text

* refactor: reorder text keys to match English structure and document closeLabel usage

* feat: add SW localized banner text

* feat: add NL localized banner text

* feat: add PL localized banner text

* feat: add PT localized banner text

* fix formatting/linting issues

* revert: remove optional cookie categories work (deferred to TP1-4033)

* revert: remove optional cookie categories work (deferred to TP1-4033)

* feat: add placeholder cookie categories and TODOs for TP1-4033

* chore: add dev-only logging and placeholder cookie categories for PR testing

* small fixes

* Move console.log to after the config has been loaded

* Remove extra code

* chore: update Civic cookie control product type to PRO_MULTISITE

Updated to reflect the new Pro Multisite licence.

* feat(cookie-control): add CCPA mode for California visitors (#16157)

* feat(cookie-control): add CCPA mode detection and ccpaConfig scaffolding

* feat(cookie-control): apply CCPA-specific text overrides across all locales

* style(cookie-control): move ...CCPA_CONFIG_SHARED to last key in all ccpaConfig blocks

* style(cookie-control): fix formatting/linting issues

* remove extra line

* fix(cookie-control): align ccpaConfig.rejectButton with rejectSettings across all locales

* Revert "fix(cookie-control): align ccpaConfig.rejectButton with rejectSettings across all locales"

This reverts commit b68c923.

* refactor(cookie-control): extract CCPA opt-out label into CCPA_TITLE and align rejectButton with rejectSettings

* fix(cookie-control): remove draft prefixes from localized ccpaConfig descriptions

* chore(cookie-control): add CCPA_TITLE for nl, note missing OneTrust CCPA text for pl

* fix(cookie-control): fall back ca and fy to English until translations are sourced

* fix(cookie-control): remove [WIP] placeholders and fall back pl to English

- Drop the [WIP] prefix from all localized closeLabel values; a TODO comment is left in place until proper translations are sourced.
- Move Polish (pl) out of CCPA_TITLE's inline object and into the English-fallback block alongside ca and fy, mirroring the pattern used for those locales.
- Replace the [WIP] Polish ccpaConfig description and name with the English text so the widget is functional rather than broken.

* fix(cookie-control): replace misplaced fr ccpaConfig description with correct CCPA intro paragraph

The French ccpaConfig.description was set to a single opt-out statement instead of the full cookie policy intro paragraph. Replaced with the correct French CCPA text. Also reformatted the nl ccpaConfig.description to use a separate line for readability (no content change).

* fix(cookie-control): wrap CCPA buttons when container is too narrow

* chore(cookie-control): remove dev-only cookie reset on page reload

* fix(cookie-control): update CCPA_CONFIG_SHARED url and date to Mozilla privacy policy

* feat: add Civic Cookie Control banner to legacy base template (#16179)

* feat: add Civic Cookie Control banner to MozFest base template (#16182)

* feat: add Civic Cookie Control banner to legacy base template

* feat: add Civic Cookie Control banner to MozFest base template

* Remove redundant code

Co-authored-by: Ram <ramon@mozillafoundation.org>

* remove extra line

---------

Co-authored-by: Ram <ramon@mozillafoundation.org>

* Configure necessary and optional cookie categories (#16202)

* Configure necessary and optional cookie categories

* Update categories

* Add missing categorie cookie and update labels

---------
Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com>

* feat(cookie-control): localize optionalCookies label/description text (#16217)

* feat(cookie-control): extract optionalCookies label/description into text.js

* feat(cookie-control): resolve optionalCookies text per locale

Extracts the static analytics/marketing config (cookies, callbacks) into BASE_OPTIONAL_COOKIES in init.js and adds withOptionalCookiesText to merge in the localized label/description from text.js, mirroring how withCCPATitle already handles the text/ccpaConfig overrides.

Adds English placeholder label/description for analytics/marketing to each locale in text.js, matching the closeLabel pattern already used for other untranslated strings. Real translations land in TP1-4033.

* style(cookie-control): use single-line strings for optionalCookies descriptions

* feat(cookie-control): add real optionalCookies translations for de, es, fr, nl, pl, pt

* docs(cookie-control): document OneTrust accept/reject label mismatch

Restores and expands the TODO noting that accept/reject button text was copied as-is from OneTrust, where the English copy says "Accept/Reject Analytics Cookies" but non-English copy says a generic "accept/reject all cookies" — the two were already out of sync in the source and need reconciling once optional category names are confirmed.

* fix(cookie-control): fix accept/reject button labels to match actual behavior

Changes the English notify-banner accept/reject text from "Accept/Reject Analytics Cookies" to "Accept All"/"Reject All", since clicking either button actually toggles both the analytics and marketing optional categories together (verified live — both end up "accepted" or both "revoked"), not just analytics. This also brings English back in line with the other locales, which already used generic "accept/reject all cookies" wording, so the previously-documented OneTrust mismatch no longer applies and that TODO is removed.

* fix(cookie-control): remove debug console.log statements (#16219)

* Remove OneTrust CMP from all Mozilla Foundation web properties (#16218)

* Remove OneTrust CMP from all Mozilla Foundation web properties

* Remove obsolete code

---------
Co-authored-by: Adalberto Cima <adalbertoc@mozillafoundation.org>

---------

Co-authored-by: Ram <ramon@mozillafoundation.org>
Co-authored-by: adalcima <cima.adalberto@gmail.com>
Co-authored-by: Adalberto Cima <adalbertoc@mozillafoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants