jetstream/cbb-row-hold-back-with-promo-v2.toml (120 lines of code) (raw):
[experiment]
[experiment.exposure_signal]
name = "opened_pbm"
friendly_name = "Opened PBM"
description = "The set of clients that opened PBM"
select_expression = "COALESCE(dom_parentprocess_private_window_used, false)"
data_source = "clients_daily_v6"
window_end = 7
[data_sources]
[data_sources.clients_daily_v6]
from_expression = "moz-fx-data-shared-prod.telemetry_derived.clients_daily_v6"
friendly_name = "Clients Daily"
description = "Clients Daily"
[data_sources.pbm_search_events]
from_expression = """(
SELECT
metrics.uuid.legacy_telemetry_client_id AS client_id,
DATE(submission_timestamp) AS submission_date,
ping_info.experiments AS experiments,
event.name AS event_name,
event.extra AS event_extra
FROM `mozdata.firefox_desktop.events`
CROSS JOIN UNNEST(events) AS event
WHERE
event.category = 'serp'
AND event.name = 'impression'
AND mozfun.map.get_key(event.extra, 'is_private') IS NOT NULL
)"""
experiments_column_type = "native"
friendly_name = "PBM search events"
description = "Glean events unnested, filtered to PBM search impressions"
[data_sources.pbm_ad_click_events]
# NOTE: from_expression queries the serp_events v1 data source, which is deprecated.
# To rerun analysis, this query must be updated to work against the v2 data source.
from_expression = """(
SELECT
legacy_telemetry_client_id AS client_id,
submission_date,
--num_ads_visible, -- can we use these instead of the manually created "core" fields?
--num_ad_clicks,
(
SELECT
SUM(
IF
((ac.component IN UNNEST(['ad_carousel', 'ad_image_row', 'ad_link', 'ad_sidebar', 'ad_sitelink']))
AND (ac.num_visible > 0), ac.num_clicks,0))
FROM
UNNEST(ad_components) ac) AS core_component_ad_clicks,
(
SELECT
SUM(
IF
((ac.component IN UNNEST(['ad_carousel', 'ad_image_row', 'ad_link', 'ad_sidebar', 'ad_sitelink'])),ac.num_visible,0))
FROM
UNNEST(ad_components) ac) AS core_component_ads_visible,
FROM
`moz-fx-data-shared-prod.firefox_desktop.serp_events` se
INNER JOIN (
SELECT
mozfun.map.get_key(event.extra,
'impression_id') AS impression_id,
FROM
`moz-fx-data-shared-prod.firefox_desktop.events`,
UNNEST(events) AS event
WHERE
event.category = 'serp'
AND mozfun.map.get_key(event.extra, 'is_private') = 'true'
AND DATE(submission_timestamp) >= '2024-07-15' ) -- impression_ids of private mode ad clicks
USING
(impression_id)
WHERE
submission_date >= '2024-07-15'
)"""
experiments_column_type = "none"
friendly_name = "PBM ad clicks"
description = "PBM search impressions enriched with ad clicks. One row per PBM SERP impression, with a column containing the number of ad clicks"
[metrics]
weekly = ['pbm_searches','pbm_uri_count', 'pbm_ad_clicks', 'pbm_searches_with_ads', 'pbm_ads_seen']
overall = ['pbm_searches','pbm_uri_count', 'pbm_ad_clicks', 'pbm_searches_with_ads', 'pbm_ads_seen']
preenrollment_weekly = ['pbm_searches','pbm_uri_count', 'pbm_ad_clicks', 'pbm_searches_with_ads', 'pbm_ads_seen']
[metrics.pbm_searches]
select_expression = "COUNT(*)"
data_source = "pbm_search_events"
[metrics.pbm_searches.statistics.bootstrap_mean]
[metrics.pbm_searches.statistics.linear_model_mean]
[metrics.pbm_searches.statistics.linear_model_mean.covariate_adjustment]
period = "preenrollment_week"
[metrics.pbm_searches_with_ads]
select_expression = "COUNTIF(core_component_ads_visible > 0)"
data_source = "pbm_ad_click_events"
[metrics.pbm_searches_with_ads.statistics.bootstrap_mean]
[metrics.pbm_searches_with_ads.statistics.linear_model_mean]
[metrics.pbm_searches_with_ads.statistics.linear_model_mean.covariate_adjustment]
period = "preenrollment_week"
[metrics.pbm_ads_seen]
select_expression = "SUM(core_component_ads_visible)"
data_source = "pbm_ad_click_events"
[metrics.pbm_ads_seen.statistics.bootstrap_mean]
[metrics.pbm_ads_seen.statistics.linear_model_mean]
[metrics.pbm_ads_seen.statistics.linear_model_mean.covariate_adjustment]
period = "preenrollment_week"
[metrics.pbm_ad_clicks]
select_expression = "COALESCE(SUM(core_component_ad_clicks),0)"
data_source = "pbm_ad_click_events"
[metrics.pbm_ad_clicks.statistics.bootstrap_mean]
[metrics.pbm_ad_clicks.statistics.linear_model_mean]
[metrics.pbm_ad_clicks.statistics.linear_model_mean.covariate_adjustment]
period = "preenrollment_week"
[metrics.pbm_uri_count]
select_expression = '''(
COALESCE(
SUM(scalar_parent_browser_engagement_total_uri_count_normal_and_private_mode_sum) -
SUM(scalar_parent_browser_engagement_total_uri_count_sum)
,0)
)'''
data_source = "clients_daily_v6"
[metrics.pbm_uri_count.statistics.bootstrap_mean]
[metrics.pbm_uri_count.statistics.linear_model_mean]
[metrics.pbm_uri_count.statistics.linear_model_mean.covariate_adjustment]
period = "preenrollment_week"