Skip to content

Commit a5837df

Browse files
Sponsored tiles outcome metrics (#1205)
Co-authored-by: Daniel Berry <[email protected]>
1 parent 042735d commit a5837df

File tree

3 files changed

+48
-18
lines changed

3 files changed

+48
-18
lines changed

definitions/fenix.toml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ data_source = "fenix_engagement_view"
503503
select_expression = "SUM(dau) / SUM(mau)"
504504
type = "scalar"
505505
description = """
506-
The Engagement Rate is calculated as the ratio between DAU and MAU. For each day, we use the single-day DAU number and divide
507-
it by the MAU corresponding to the 28-day period ending on that day. For OKR reporting, we then calculate a
506+
The Engagement Rate is calculated as the ratio between DAU and MAU. For each day, we use the single-day DAU number and divide
507+
it by the MAU corresponding to the 28-day period ending on that day. For OKR reporting, we then calculate a
508508
28-day moving average of this number. More information is provided on the
509509
[New Profiles, Retention and Engagement Rate Confluence Page](https://mozilla-hub.atlassian.net/wiki/spaces/DATA/pages/814481685/Firefox+New+Profiles+Retention+and+Engagement#Engagement-Rate).
510510
"""
@@ -528,7 +528,7 @@ data_source = "fenix_retention_view"
528528
select_expression = "SUM(retained_week_4_new_profiles) / SUM(new_profiles_metric_date)"
529529
type = "scalar"
530530
description = """
531-
The New Profile Retention Rate is calculated as the proportion of new profiles that are active on the 4th week after the metric date.
531+
The New Profile Retention Rate is calculated as the proportion of new profiles that are active on the 4th week after the metric date.
532532
More information is provided on the
533533
[New Profiles, Retention and Engagement Rate Confluence Page](https://mozilla-hub.atlassian.net/wiki/spaces/DATA/pages/814481685/Firefox+New+Profiles+Retention+and+Engagement#New-Profile-Retention).
534534
"""
@@ -596,6 +596,27 @@ description = "Events Ping"
596596
build_id_column = "REPLACE(CAST(DATE(mozfun.norm.fenix_build_to_datetime(client_info.app_build)) AS STRING), '-', '')"
597597

598598

599+
[data_sources.sponsored_tiles_events_stream]
600+
from_expression = """(
601+
SELECT
602+
p.client_id,
603+
p.event_category,
604+
p.event_name,
605+
p.experiments,
606+
p.event_extra,
607+
DATE(p.submission_timestamp) AS submission_date
608+
FROM
609+
`moz-fx-data-shared-prod.{dataset}.events_stream` p
610+
WHERE p.event_category in ('customize_home', 'top_sites')
611+
)"""
612+
client_id_column = "client_id"
613+
experiments_column_type = "events_stream"
614+
default_dataset = "fenix"
615+
friendly_name = "Sponsored Tiles Events Stream"
616+
description = "Sponsored tiles Events pings from events stream"
617+
build_id_column = "REPLACE(CAST(DATE(mozfun.norm.fenix_build_to_datetime(client_info.app_build)) AS STRING), '-', '')"
618+
619+
599620
[data_sources.events_stream_awesomebar]
600621
from_expression = """(
601622
SELECT
@@ -730,7 +751,7 @@ LEFT JOIN (
730751
FROM
731752
`mozdata.org_mozilla_firefox.events_stream` tm
732753
733-
WHERE event_category = "onboarding"
754+
WHERE event_category = "onboarding"
734755
AND JSON_QUERY(event_extra, "$.action") IS NOT NULL
735756
AND event_name in ("set_to_default", "turn_on_notifications", "sign_in")
736757
AND DATE(submission_timestamp) >= "2023-01-01"

jetstream/outcomes/fenix/sponsored_tiles.toml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ friendly_name = "Sponsored Tiles Impressions"
77
description = "Number of times Contile Sponsored Tiles are shown."
88
select_expression = """
99
COALESCE(COUNTIF(
10-
event.category = 'top_sites'
11-
AND event.name = 'contile_impression'
10+
event_category = 'top_sites'
11+
AND event_name = 'contile_impression'
1212
),0)
1313
"""
14-
data_source = "events"
14+
data_source = "sponsored_tiles_events_stream"
1515
statistics = { bootstrap_mean = {}, deciles = {} }
1616

1717

@@ -20,37 +20,38 @@ friendly_name = "Sponsored Tiles Clicks"
2020
description = "Number of times user clicked a Contile Sponsored Tile."
2121
select_expression = """
2222
COALESCE(COUNTIF(
23-
event.category = 'top_sites'
24-
AND event.name = 'contile_click'
23+
event_category = 'top_sites'
24+
AND event_name = 'contile_click'
2525
),0)
2626
"""
27-
data_source = "events"
27+
data_source = "sponsored_tiles_events_stream"
2828
statistics = { bootstrap_mean = {}, deciles = {} }
2929

3030
[metrics.spoc_tiles_disable_rate]
31-
select_expression = """
31+
select_expression = """
3232
COALESCE(MAX(
3333
CAST(
3434
metrics.boolean.customize_home_contile AS int )
3535
),0)
3636
"""
37-
data_source = "metrics"
37+
data_source = "metrics"
3838
bigger_is_better = false
3939
friendly_name = "Sponsored Tiles Disable Rate"
4040
description = "Fraction of users who disable Contile Sponsored Tiles"
4141
[metrics.spoc_tiles_disable_rate.statistics.binomial]
4242

4343
[metrics.spoc_tiles_preference_toggled]
44-
select_expression = """
44+
select_expression = """
4545
COALESCE(SUM(CASE WHEN
46-
event.category = 'customize_home'
47-
AND event.name = 'preference_toggled'
48-
AND `mozfun.map.get_key`(event.extra, 'preference_key') = 'contile'
46+
event_category = 'customize_home'
47+
AND event_name = 'preference_toggled'
48+
AND JSON_VALUE(event_extra, '$.preference_key') = 'contile'
49+
--AND `mozfun.map.get_key`(event_extra, 'preference_key') = 'contile'
4950
THEN 1 ELSE 0 END
5051
),0)
5152
"""
52-
data_source = "events"
53+
data_source = "sponsored_tiles_events_stream"
5354
bigger_is_better = false
5455
friendly_name = "Sponsored Tiles Preference Toggled"
5556
description = "Number of times Contile Sponsored Tiles setting is flipped."
56-
statistics = { bootstrap_mean = {}, deciles = {} }
57+
statistics = { bootstrap_mean = {}, deciles = {} }

jetstream/search-middle.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[experiment]
2+
3+
start_date = "2025-09-03"
4+
5+
#enrollment_end_date = "2025-09-25"
6+
enrollment_period = 22
7+
8+
end_date = "2025-10-29"

0 commit comments

Comments
 (0)