# 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/.

---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
$tags:
  - 'Firefox :: IP Protection'

ipprotection:
  alert_button_clicked:
    type: event
    description: >
      Recorded when a user clicks "Continue without VPN" or "Close all tabs" in the VPN alert.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2020503
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2020503
    data_sensitivity:
      - interaction
    notification_emails:
      - kpatenio@mozilla.com
      - vpn-telemetry@mozilla.com
    expires: never
    extra_keys:
      buttonType:
        type: quantity
        description: >
          Action taken by the user, represented as an integer.
          0 = continue without VPN
          1 = close all tabs
      reason:
        type: string
        description: >
          Reason why the alert was triggered: "paused" or "error".

  click_upgrade_button:
    type: event
    description: >
      This is recorded when a user clicks the upgrade button in the VPN panel.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1972930
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1972930
    notification_emails:
      - rking@mozilla.com
      - vpn-telemetry@mozilla.com
    expires: never

  removed_from_toolbar:
    type: event
    description: >
      Recorded when the IP Protection widget is removed from the toolbar.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2017739
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2017739
    data_sensitivity:
      - interaction
    notification_emails:
      - mhynson@mozilla.com
      - vpn-telemetry@mozilla.com
    expires: never

  bandwidth_used_threshold:
    type: event
    description: >
      Recorded when the percentage of bandwidth used crosses a threshold of 50,
      75, or 90%.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2017744
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2017744
    data_sensitivity:
      - interaction
    notification_emails:
      - mhynson@mozilla.com
      - vpn-telemetry@mozilla.com
    expires: never
    extra_keys:
      percentage:
        type: quantity
        description: >
          The bandwidth usage threshold that was crossed (50, 75, or 90).

  exclusion_toggled:
    type: event
    description: >
      Recorded when a site exclusion is added or removed using the panel toggle UI.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2017487
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2017487
    data_sensitivity:
      - interaction
    notification_emails:
      - kpatenio@mozilla.com
      - vpn-telemetry@mozilla.com
    expires: never
    extra_keys:
      excluded:
        type: boolean
        description: >
          True if the site was excluded (VPN disabled for site).
          False if the exclusion was removed (VPN re-enabled for site).

  get_started:
    type: event
    description: >
      Recorded when the user clicks the get started button in the panel or settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2017484
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2017484
    data_sensitivity:
      - interaction
    notification_emails:
      - fchasen@mozilla.com
      - vpn-telemetry@mozilla.com
    expires: never

  enrollment:
    type: event
    description: >
      Recorded when an account has been enrolled after completing the sign up flow.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2017484
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2017484
    data_sensitivity:
      - interaction
    notification_emails:
      - fchasen@mozilla.com
      - vpn-telemetry@mozilla.com
    expires: never
    extra_keys:
      enrolled:
        type: boolean
        description: >
          True if the enrollment finished successfully.

  location_selector_button_clicked:
    type: event
    description: >
      Recorded when a user clicks the location selector button to open the
      locations subview.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2035944
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2035944
    data_sensitivity:
      - interaction
    notification_emails:
      - kpatenio@mozilla.com
      - vpn-telemetry@mozilla.com
    expires: never

  location_changed:
    type: event
    description: >
      Recorded when a user picks a new egress location from the location selector.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2035944
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2035944
    data_sensitivity:
      - interaction
    notification_emails:
      - kpatenio@mozilla.com
      - vpn-telemetry@mozilla.com
    expires: never
    extra_keys:
      location:
        type: string
        description: >
          The country code of the selected egress location, or "REC" if the
          recommended location was selected.

  location_upgrade_promo_clicked:
    type: event
    description: >
      Recorded when a user clicks the upgrade promo button in the locations
      subview.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2035944
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2035944
    data_sensitivity:
      - interaction
    notification_emails:
      - kpatenio@mozilla.com
      - vpn-telemetry@mozilla.com
    expires: never
