summaryrefslogtreecommitdiffstats
path: root/toolkit/components/cookiebanners/metrics.yaml
blob: 8dabab39f329d5b397ce2e72f3ea440f4a2a393a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
# 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
      - pbz@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
      - pbz@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
      - pbz@mozilla.com
    expires: never
    telemetry_mirror: COOKIE_BANNERS_SERVICE_DETECT_ONLY
  rule_lookup_by_load:
    type: labeled_counter
    description: >
      Counts the number of hit/miss of cookie banner rule lookups for every
      load. We collect three types of counters, including counters for overall
      rule lookup, counters for cookie rule lookup and counters for click rule
      lookup. We also divide the counter by top-level loads and iframe loads.
    bugs:
      - https://bugzilla.mozilla.org/1797073
      - https://bugzilla.mozilla.org/1804259
      - https://bugzilla.mozilla.org/1827765
      - https://bugzilla.mozilla.org/1850874
      - https://bugzilla.mozilla.org/1861317
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1797073#c6
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1827765#c9
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1850874#c7
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1861317#c3
    data_sensitivity:
      - interaction
    notification_emails:
      - tihuang@mozilla.com
      - pbz@mozilla.com
    expires: 128
    labels:
      - top_hit
      - top_hit_opt_in
      - top_hit_opt_out
      - top_miss
      - iframe_hit
      - iframe_hit_opt_in
      - iframe_hit_opt_out
      - iframe_miss
      - top_cookie_hit
      - top_cookie_hit_opt_in
      - top_cookie_hit_opt_out
      - top_cookie_miss
      - iframe_cookie_hit
      - iframe_cookie_hit_opt_in
      - iframe_cookie_hit_opt_out
      - iframe_cookie_miss
      - top_click_hit
      - top_click_hit_opt_in
      - top_click_hit_opt_out
      - top_click_miss
      - iframe_click_hit
      - iframe_click_hit_opt_in
      - iframe_click_hit_opt_out
      - iframe_click_miss
    telemetry_mirror: COOKIE_BANNERS_RULE_LOOKUP_BY_LOAD
  rule_lookup_by_domain:
    type: labeled_counter
    description: >
      Counts the number of hit/miss of cookie banner rule lookups for domain.
      We collect three types of counters, including counters for overall
      rule lookup, counters for cookie rule lookup and counters for click rule
      lookup. We also divide the counter by top-level loads and iframe loads.
      For each domain, we will only collect once.
    bugs:
      - https://bugzilla.mozilla.org/1797073
      - https://bugzilla.mozilla.org/1804259
      - https://bugzilla.mozilla.org/1827765
      - https://bugzilla.mozilla.org/1850874
      - https://bugzilla.mozilla.org/1861317
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1797073#c6
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1827765#c9
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1850874#c7
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1861317#c3
    data_sensitivity:
      - interaction
    notification_emails:
      - tihuang@mozilla.com
      - pbz@mozilla.com
    expires: 128
    labels:
      - top_hit
      - top_hit_opt_in
      - top_hit_opt_out
      - top_miss
      - iframe_hit
      - iframe_hit_opt_in
      - iframe_hit_opt_out
      - iframe_miss
      - top_cookie_hit
      - top_cookie_hit_opt_in
      - top_cookie_hit_opt_out
      - top_cookie_miss
      - iframe_cookie_hit
      - iframe_cookie_hit_opt_in
      - iframe_cookie_hit_opt_out
      - iframe_cookie_miss
      - top_click_hit
      - top_click_hit_opt_in
      - top_click_hit_opt_out
      - top_click_miss
      - iframe_click_hit
      - iframe_click_hit_opt_in
      - iframe_click_hit_opt_out
      - iframe_click_miss
    telemetry_mirror: COOKIE_BANNERS_RULE_LOOKUP_BY_DOMAIN
  reload:
    type: event
    description: >
      Recorded when the top-level page is reloaded. We use this event metric to
      know whether or not the reloading domain has cookie banner rule.
    bugs:
      - https://bugzilla.mozilla.org/1797079
      - https://bugzilla.mozilla.org/1827765
      - https://bugzilla.mozilla.org/1850874
      - https://bugzilla.mozilla.org/1861317
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1797079#c6
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1827765#c9
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1850874#c7
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1861317#c3
    notification_emails:
      - pbz@mozilla.com
      - tihuang@mozilla.com
    expires: 128
    data_sensitivity:
      - interaction
    extra_keys:
      no_rule:
        description: There is no cookie banner rule for the reloading domain.
        type: boolean
      has_cookie_rule:
        description: There is a matching cookie rule for the reloading domain.
        type: boolean
      has_click_rule:
        description: There is a matching click rule for the reloading domain.
        type: boolean
    telemetry_mirror: Cookie_banner_Reload_Browser
  cookie_injection_fail:
    type: counter
    description: >
      Counts how often the cookie banner is still shown even if we have injected
      cookies.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1813128
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1813128#c10
    data_sensitivity:
      - interaction
    notification_emails:
      - pbz@mozilla.com
      - tihuang@mozilla.com
    expires: 128
cookie.banners.click:
  handle_duration:
    type: timing_distribution
    time_unit: millisecond
    description: >
      Counts how long it takes to handle cookie banners successfully from
      DOMContentLoaded until click.
    bugs:
      - https://bugzilla.mozilla.org/1797078
      - https://bugzilla.mozilla.org/1804259
      - https://bugzilla.mozilla.org/1827765
      - https://bugzilla.mozilla.org/1850874
      - https://bugzilla.mozilla.org/1861317
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1797078#c6
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1827765#c9
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1850874#c7
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1861317#c3
    notification_emails:
      - pbz@mozilla.com
      - tihuang@mozilla.com
    expires: 128
    telemetry_mirror: COOKIE_BANNERS_CLICK_HANDLE_DURATION_MS
  # TODO: consider moving this out of "click". It also records cookie injection.
  result:
    type: labeled_counter
    description: >
      Given a matching cookie banner rule, how often do we handle or fail to
      handle cookie banners, labelled by reason. The 'success' and 'fail'
      counters count the total numbers independently of the reason counters.
      Counters are incremented after the content window has been destroyed. This
      metric additionally reports cookie injections after which we didn't see a
      banner as "success_cookie_injected".
    bugs:
      - https://bugzilla.mozilla.org/1797078
      - https://bugzilla.mozilla.org/1804259
      - https://bugzilla.mozilla.org/1821738
      - https://bugzilla.mozilla.org/1827765
      - https://bugzilla.mozilla.org/1850874
      - https://bugzilla.mozilla.org/1861317
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1797078#c6
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1827765#c9
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1850874#c7
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1861317#c3
    notification_emails:
      - pbz@mozilla.com
      - tihuang@mozilla.com
    expires: 128
    labels:
      - success
      - success_cookie_injected
      - success_dom_content_loaded
      - success_mutation_pre_load
      - success_mutation_post_load
      - fail
      - fail_banner_not_found
      - fail_banner_not_visible
      - fail_button_not_found
      - fail_no_rule_for_mode
      - fail_actor_destroyed
    telemetry_mirror: COOKIE_BANNERS_CLICK_RESULT
  query_selector_run_count_per_window_top_level:
    type: custom_distribution
    bucket_count: 20
    range_max: 2500
    histogram_type: exponential
    description: >
      How often a query selector is run during the lifetime of a top-level
      content window.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1855495
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1855495#c3
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1871200#c4
    notification_emails:
      - pbz@mozilla.com
      - tihuang@mozilla.com
    expires: 128
  query_selector_run_count_per_window_frame:
    type: custom_distribution
    bucket_count: 20
    range_max: 2500
    histogram_type: exponential
    description: >
      How often a query selector is run during the lifetime of a sub-frame
      content window.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1855495
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1855495#c3
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1871200#c4
    notification_emails:
      - pbz@mozilla.com
      - tihuang@mozilla.com
    expires: 128
  query_selector_run_duration_per_window_top_level:
    type: custom_distribution
    bucket_count: 8
    range_max: 30000000
    histogram_type: exponential
    description: >
      Total time spent (in microseconds) on running querySelector for the
      lifetime of a top-level content window.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1855495
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1855495#c3
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1871200#c4
    notification_emails:
      - pbz@mozilla.com
      - tihuang@mozilla.com
    expires: 128
  query_selector_run_duration_per_window_frame:
    type: custom_distribution
    bucket_count: 8
    range_max: 30000000
    histogram_type: exponential
    description: >
      Total time spent (in microseconds) on running querySelector for the
      lifetime of a sub-frame content window.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1855495
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1855495#c3
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1871200#c4
    notification_emails:
      - pbz@mozilla.com
      - tihuang@mozilla.com
    expires: 128
cookie.banners.cmp:
  ratio_handled_by_cmp_rule:
    type: rate
    description: >
      The proportion of cookie banners handled by CMP rules within the total
      number of cases handled, including those handled by site-specific rules.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1813128
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1813128#c10
    data_sensitivity:
      - interaction
    notification_emails:
      - pbz@mozilla.com
      - tihuang@mozilla.com
    expires: 128
  detected_cmp:
    type: labeled_counter
    description: >
      Counts how often a specific cmp has been detected by our cookie banner
      handling.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1813128
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1813128#c10
    data_sensitivity:
      - interaction
    notification_emails:
      - pbz@mozilla.com
      - tihuang@mozilla.com
    expires: 128
  result:
    type: labeled_counter
    description: >
      Given a matching CMP rule, how often do we handle or fail to handle cookie
      banners, labelled by reason. The 'success' and 'fail' counters count the
      total numbers independently of the reason counters. Counters are
      incremented after the content window has been destroyed.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1813128
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1813128#c10
    data_sensitivity:
      - interaction
    notification_emails:
      - pbz@mozilla.com
      - tihuang@mozilla.com
    expires: 128
    labels:
      - success
      - success_dom_content_loaded
      - success_mutation_pre_load
      - success_mutation_post_load
      - fail
      - fail_banner_not_found
      - fail_banner_not_visible
      - fail_button_not_found
      - fail_no_rule_for_mode
      - fail_actor_destroyed
  handle_duration:
    type: timing_distribution
    time_unit: millisecond
    description: >
      Counts how long it takes to handle cookie banners successfully using CMP
      rules from DOMContentLoaded until click. This metric is a variant of the
      cookieBanners.click.handle_duration.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1813128
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1813128#c10
    data_sensitivity:
      - interaction
    notification_emails:
      - pbz@mozilla.com
      - tihuang@mozilla.com
    expires: 128