|
| 1 | +[experiment] |
| 2 | + |
| 3 | +segments = [ |
| 4 | + "activity_infrequent_or_casual", |
| 5 | + "last_dau_2_to_4_weeks_ago", |
| 6 | + "last_dau_5_to_8_weeks_ago", |
| 7 | + "last_dau_more_than_8_weeks_ago", |
| 8 | + "last_dau_more_than_4_weeks_ago", |
| 9 | + "never_user", |
| 10 | + "new_unique_profiles", |
| 11 | +] |
| 12 | + |
| 13 | +[metrics] |
| 14 | + |
| 15 | +weekly = [ |
| 16 | + "is_pinned", |
| 17 | + "is_default_browser", |
| 18 | + "number_of_desktop_launches", |
| 19 | + "number_of_taskbar_launches", |
| 20 | + "number_of_startmenu_launches", |
| 21 | + "number_of_taskbartab_launches", |
| 22 | + "unique_client_installs", |
| 23 | + "unique_client_pins", |
| 24 | + "web_app_launches", |
| 25 | + "web_app_active_users", |
| 26 | +] |
| 27 | + |
| 28 | +overall = [ |
| 29 | + "is_pinned", |
| 30 | + "is_default_browser", |
| 31 | + "number_of_desktop_launches", |
| 32 | + "number_of_taskbar_launches", |
| 33 | + "number_of_startmenu_launches", |
| 34 | + "number_of_taskbartab_launches", |
| 35 | + "unique_client_installs", |
| 36 | + "unique_client_pins", |
| 37 | + "web_app_launches", |
| 38 | + "web_app_active_users", |
| 39 | +] |
| 40 | + |
| 41 | +[metrics.number_of_desktop_launches.statistics.bootstrap_mean] |
| 42 | +drop_highest = 0.0005 |
| 43 | + |
| 44 | +[metrics.number_of_taskbar_launches.statistics.bootstrap_mean] |
| 45 | +drop_highest = 0.0005 |
| 46 | + |
| 47 | +[metrics.number_of_startmenu_launches.statistics.bootstrap_mean] |
| 48 | +drop_highest = 0.0005 |
| 49 | + |
| 50 | +[metrics.number_of_taskbartab_launches.statistics.bootstrap_mean] |
| 51 | +drop_highest = 0.0005 |
| 52 | + |
| 53 | +[metrics.unique_client_installs.statistics.bootstrap_mean] |
| 54 | +drop_highest = 0.0005 |
| 55 | + |
| 56 | +[metrics.unique_client_pins.statistics.bootstrap_mean] |
| 57 | +drop_highest = 0.0005 |
| 58 | + |
| 59 | +[metrics.web_app_launches.statistics.bootstrap_mean] |
| 60 | +drop_highest = 0.0005 |
| 61 | + |
| 62 | +[metrics.web_app_active_users.statistics.binomial] |
| 63 | + |
| 64 | +[metrics.web_app_active_users] |
| 65 | +friendly_name = "Web App Active Users" |
| 66 | +description = "Percentage of clients who had non-zero usage time" |
| 67 | +select_expression = """ |
| 68 | + COALESCE(SUM(metrics.timing_distribution.web_app_usage_time.sum),0) > 0 |
| 69 | +""" |
| 70 | +data_source = "metrics" |
| 71 | + |
| 72 | +[metrics.unique_client_installs] |
| 73 | +friendly_name = "Installed Web App" |
| 74 | +description = "Average Installed Web Apps per user (approx from install and uninstall events)" |
| 75 | +select_expression = """ |
| 76 | + COALESCE(SUM(CASE WHEN event_name = 'install' THEN cumulative_count END),0) - |
| 77 | + COALESCE(SUM(CASE WHEN event_name = 'uninstall' THEN cumulative_count END),0) |
| 78 | +""" |
| 79 | +data_source = "web_app_events" |
| 80 | + |
| 81 | +[metrics.unique_client_pins] |
| 82 | +friendly_name = "Pinned Web Apps" |
| 83 | +description = "Average Pinned Web Apps per user (approx from pin and unpin events)" |
| 84 | +select_expression = """ |
| 85 | + COALESCE(SUM(CASE WHEN event_name = 'pin' THEN cumulative_count END),0) - |
| 86 | + COALESCE(SUM(CASE WHEN event_name = 'unpin' THEN cumulative_count END),0) |
| 87 | +""" |
| 88 | +data_source = "web_app_events" |
| 89 | + |
| 90 | +[metrics.web_app_launches] |
| 91 | +friendly_name = "Web App Launches" |
| 92 | +description = "Average Web Apps Launches per user (approx from activate and move to taskbar events)" |
| 93 | +select_expression = """ |
| 94 | + COALESCE(SUM(CASE WHEN event_name = 'activate' THEN cumulative_count END),0) - |
| 95 | + COALESCE(SUM(CASE WHEN event_name = 'install' THEN cumulative_count END),0) |
| 96 | +""" |
| 97 | +data_source = "web_app_events" |
| 98 | + |
| 99 | +[data_sources.web_app_events] |
| 100 | +from_expression = """( |
| 101 | +WITH events AS ( |
| 102 | +SELECT |
| 103 | + CAST(submission_timestamp as DATE) as submission_date, |
| 104 | + legacy_telemetry_client_id as client_id, |
| 105 | + profile_group_id, |
| 106 | + event_name, |
| 107 | + COUNT(1) as event_count |
| 108 | +FROM `moz-fx-data-shared-prod.firefox_desktop.events_stream` |
| 109 | +WHERE |
| 110 | + event_category = 'web_app' |
| 111 | + AND event_name IN ('install', 'uninstall', 'pin', 'unpin', 'activate') |
| 112 | + AND DATE(submission_timestamp) >= '2025-10-27' |
| 113 | +GROUP BY ALL |
| 114 | +) |
| 115 | + SELECT |
| 116 | + submission_date, |
| 117 | + client_id, |
| 118 | + profile_group_id, |
| 119 | + event_name, |
| 120 | + SUM(event_count) OVER (PARTITION BY client_id, event_name ORDER BY submission_date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as cumulative_count |
| 121 | + FROM events |
| 122 | +)""" |
| 123 | +experiments_column_type = "none" |
| 124 | +friendly_name = "Web App Events" |
| 125 | +description = "Events for Web App (Taskbar Tabs)" |
| 126 | + |
| 127 | +# ============================================================================ |
| 128 | +# USER SEGMENTS - Based on activity patterns before enrollment |
| 129 | +# ============================================================================ |
| 130 | +# Using e.enrollment_date to reference enrollment date |
| 131 | +# (see https://github.com/mozilla/mozanalysis/blob/ccabadcc5233a1f48f528fa4a23e3495b3ac9ea2/src/mozanalysis/segments.py#L132-L156) |
| 132 | +# Using a 26 week lookback window (182 days) |
| 133 | + |
| 134 | +[segments.last_dau_2_to_4_weeks_ago] |
| 135 | +friendly_name = "Last DAU 2 to 4 weeks ago" |
| 136 | +description = "Clients who last counted towards DAU 2-4 weeks (15-28 days) ago" |
| 137 | +select_expression = 'DATE_DIFF(MAX(e.enrollment_date), MAX(last_active_date), DAY) BETWEEN 15 AND 28' |
| 138 | +data_source = "active_users_last_seen" |
| 139 | +window_start = -182 |
| 140 | +window_end = -1 |
| 141 | + |
| 142 | +[segments.last_dau_5_to_8_weeks_ago] |
| 143 | +friendly_name = "Last DAU 5 to 8 weeks ago" |
| 144 | +description = "Clients who last counted towards DAU 5-8 weeks (29-56 days) ago" |
| 145 | +select_expression = 'DATE_DIFF(MAX(e.enrollment_date), MAX(last_active_date), DAY) BETWEEN 29 AND 56' |
| 146 | +data_source = "active_users_last_seen" |
| 147 | +window_start = -182 |
| 148 | +window_end = -1 |
| 149 | + |
| 150 | +[segments.last_dau_more_than_8_weeks_ago] |
| 151 | +friendly_name = "Last DAU more than 8 weeks ago" |
| 152 | +description = "Clients who last counted towards DAU more than 8 weeks (56 days) ago" |
| 153 | +select_expression = 'DATE_DIFF(MAX(e.enrollment_date), MAX(last_active_date), DAY) > 56' |
| 154 | +data_source = "active_users_last_seen" |
| 155 | +window_start = -182 |
| 156 | +window_end = -1 |
| 157 | + |
| 158 | +[segments.last_dau_more_than_4_weeks_ago] |
| 159 | +friendly_name = "Last DAU more than 4 weeks ago" |
| 160 | +description = "Clients who last counted towards DAU more than 4 weeks (28 days) ago" |
| 161 | +select_expression = 'DATE_DIFF(MAX(e.enrollment_date), MAX(last_active_date), DAY) > 28' |
| 162 | +data_source = "active_users_last_seen" |
| 163 | +window_start = -182 |
| 164 | +window_end = -1 |
| 165 | + |
| 166 | +[segments.never_user] |
| 167 | +friendly_name = "No recorded DAU" |
| 168 | +description = "Clients who did not provide any recorded DAU in the period" |
| 169 | +select_expression = 'MAX(last_active_date) IS NULL' |
| 170 | +data_source = "active_users_last_seen" |
| 171 | +window_start = -182 |
| 172 | +window_end = -1 |
| 173 | + |
| 174 | +[segments.data_sources.active_users_last_seen] |
| 175 | +from_expression = """( |
| 176 | + SELECT |
| 177 | + client_id, |
| 178 | + profile_group_id, |
| 179 | + MAX(submission_date) as last_active_date, |
| 180 | + MAX(submission_date) as submission_date |
| 181 | + FROM `mozdata.telemetry.desktop_active_users` |
| 182 | + WHERE is_desktop |
| 183 | + AND is_dau |
| 184 | + AND submission_date >= "2025-04-01" |
| 185 | + GROUP BY client_id, profile_group_id |
| 186 | +)""" |
0 commit comments