# 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 http://mozilla.org/MPL/2.0/.

# Adding a new metric? We have docs for that!
# https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/new_definitions_file.html

---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
$tags:
  - 'Core :: Privacy: Anti-Tracking'

cookie.banners:
  normal_window_service_mode:
    type: labeled_boolean
    description: >
      The pref value of the cookie banner service mode for normal windows.
    bugs:
      - https://bugzilla.mozilla.org/1797081
      - https://bugzilla.mozilla.org/1804259
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1797081#c3
    notification_emails:
      - tihuang@mozilla.com
      - emz@mozilla.com
    expires: never
    labels:
      - disabled
      - reject
      - reject_or_accept
      - invalid
    telemetry_mirror: COOKIE_BANNERS_NORMAL_WINDOW_SERVICE_MODE
  private_window_service_mode:
    type: labeled_boolean
    description: >
      The pref value of the cookie banner service mode for private windows.
    bugs:
      - https://bugzilla.mozilla.org/1797081
      - https://bugzilla.mozilla.org/1804259
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1797081#c3
    notification_emails:
      - tihuang@mozilla.com
      - emz@mozilla.com
    expires: never
    labels:
      - disabled
      - reject
      - reject_or_accept
      - invalid
    telemetry_mirror: COOKIE_BANNERS_PRIVATE_WINDOW_SERVICE_MODE
  service_detect_only:
    type: boolean
    description: >
      Tracks the value of the cookiebanners.service.detectOnly pref.
    bugs:
      - https://bugzilla.mozilla.org/1809700
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1809700#c3
    notification_emails:
      - tihuang@mozilla.com
      - emz@mozilla.com
    expires: never
    telemetry_mirror: COOKIE_BANNERS_SERVICE_DETECT_ONLY
  google_gdpr_choice_cookie:
    type: labeled_string
    description: >
      Records the GDPR choice on Google Search based on the "SOCS" cookie of the
      Google Search domains. The value could be "Accept", "Reject" or "Custom".
      We use the label to record different choices on different Google domains.
      We only collect this if the default search engine is Google.
    bugs:
      - https://bugzilla.mozilla.org/1874741
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1874741#c10
    data_sensitivity:
      - stored_content
    notification_emails:
      - emz@mozilla.com
      - tihuang@mozilla.com
    expires: never
  google_gdpr_choice_cookie_event:
    type: event
    description: >
      Recorded whenever a GDPR choice is made on a Google Search page. We assess
      the "SOCS" cookie to know the GDPR choice.
    bugs:
      - https://bugzilla.mozilla.org/1874741
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1874741#c10
    data_sensitivity:
      - stored_content
    notification_emails:
      - emz@mozilla.com
      - tihuang@mozilla.com
    expires: never
    extra_keys:
      search_domain:
        description: The Google search domain where the GDPR choice was made.
        type: string
      choice:
        description: >
          The GDPR choice. The value could be "Accept", "Reject" or "Custom".
        type: string
      region:
        description: >
          The region where the GDPR consent is made. This is based on the IP
          location.
        type: string
  google_gdpr_choice_cookie_event_pbm:
    type: event
    description: >
      Recorded whenever a GDPR choice is made on a Google Search page on private
      browsing windows. We assess the "SOCS" cookie to know the GDPR choice.
    bugs:
      - https://bugzilla.mozilla.org/1874741
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1874741#c10
    data_sensitivity:
      - stored_content
    notification_emails:
      - emz@mozilla.com
      - tihuang@mozilla.com
    expires: never
    extra_keys:
      choice:
        description: >
          The GDPR choice. The value could be "Accept", "Reject" or "Custom".
        type: string
