From 000a50831ab250a2f2f9e4a0935d1202965e8b42 Mon Sep 17 00:00:00 2001 From: "Sergio E. Betancourt" <37666064+sergiosonline@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:36:34 -0500 Subject: [PATCH] Adding spons tiles configured telemetry to newtab clients and visits (#6380) * Adding spons tiles configured telemetry to newtab clients and visits * ran bqetl format * Adding new field to tests * Adding new field to tests * fix tests --------- Co-authored-by: m-d-bowerman --- .../telemetry_derived/newtab_clients_daily_v1/query.sql | 9 ++++++--- .../newtab_clients_daily_v1/schema.yaml | 5 +++++ .../telemetry_derived/newtab_visits_v1/query.sql | 3 +++ .../telemetry_derived/newtab_visits_v1/schema.yaml | 5 +++++ ...red-prod.firefox_desktop_stable.newtab_v1.schema.json | 5 +++++ .../newtab_visits_v1/test_aggregation/expect.yaml | 1 + ...ata-shared-prod.firefox_desktop_stable.newtab_v1.yaml | 2 ++ 7 files changed, 27 insertions(+), 3 deletions(-) diff --git a/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/query.sql b/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/query.sql index 11ef5b50ad..fee2077763 100644 --- a/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/query.sql +++ b/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/query.sql @@ -35,7 +35,8 @@ WITH visits_data_base AS ( topic_selection_interactions, newtab_default_ui, newtab_selected_topics, - profile_group_id + profile_group_id, + topsites_sponsored_tiles_configured FROM `moz-fx-data-shared-prod.telemetry_derived.newtab_visits_v1` WHERE @@ -81,7 +82,8 @@ visits_data AS ( COUNTIF(newtab_default_ui = "non-default") AS visits_with_non_default_ui, LOGICAL_OR(is_new_profile) AS is_new_profile, ANY_VALUE(activity_segment) AS activity_segment, - LOGICAL_OR(ARRAY_LENGTH(newtab_selected_topics) > 0) AS topic_preferences_set + LOGICAL_OR(ARRAY_LENGTH(newtab_selected_topics) > 0) AS topic_preferences_set, + ANY_VALUE(topsites_sponsored_tiles_configured) AS topsites_sponsored_tiles_configured FROM visits_data_base GROUP BY @@ -297,7 +299,8 @@ SELECT COALESCE(topic_selection_data.topic_selection_updates, 0) AS topic_selection_updates, COALESCE(topic_selection_data.topic_selection_opened, 0) AS topic_selection_opened, COALESCE(topic_selection_data.topic_selection_dismissals, 0) AS topic_selection_dismissals, - visits_data.profile_group_id AS profile_group_id + visits_data.profile_group_id AS profile_group_id, + visits_data.topsites_sponsored_tiles_configured AS topsites_sponsored_tiles_configured FROM visits_data LEFT JOIN diff --git a/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/schema.yaml b/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/schema.yaml index 6f59824cec..e94b04e6c0 100644 --- a/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/schema.yaml +++ b/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/schema.yaml @@ -257,3 +257,8 @@ fields: - name: profile_group_id type: STRING mode: NULLABLE +- name: topsites_sponsored_tiles_configured + type: INTEGER + mode: NULLABLE + description: An integer from client configuration that determines how many tiles the client can see. + This telemetry released in Fx123 (2024/02/20), so it should only be considered for clients with Fx123+. diff --git a/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/query.sql b/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/query.sql index e39f6ab22a..407b2ad86a 100644 --- a/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/query.sql +++ b/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/query.sql @@ -42,6 +42,9 @@ visit_metadata AS ( ANY_VALUE(metrics.boolean.pocket_sponsored_stories_enabled) AS pocket_sponsored_stories_enabled, ANY_VALUE(metrics.boolean.topsites_enabled) AS topsites_enabled, ANY_VALUE(metrics.boolean.topsites_sponsored_enabled) AS topsites_sponsored_enabled, + ANY_VALUE( + metrics.quantity.topsites_sponsored_tiles_configured + ) AS topsites_sponsored_tiles_configured, ANY_VALUE(metrics.string.newtab_homepage_category) AS newtab_homepage_category, ANY_VALUE(metrics.string.newtab_newtab_category) AS newtab_newtab_category, ANY_VALUE(metrics.boolean.newtab_search_enabled) AS newtab_search_enabled, diff --git a/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/schema.yaml b/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/schema.yaml index 22323f3c7c..4d7fa0929d 100644 --- a/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/schema.yaml +++ b/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/schema.yaml @@ -379,3 +379,8 @@ fields: - name: newtab_window_inner_width type: INTEGER mode: NULLABLE +- mode: NULLABLE + name: topsites_sponsored_tiles_configured + type: INTEGER + description: An integer from client configuration that determines how many tiles the client can see. + This telemetry released in Fx123 (2024/02/20), so it should only be considered for clients with Fx123+. diff --git a/tests/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/moz-fx-data-shared-prod.firefox_desktop_stable.newtab_v1.schema.json b/tests/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/moz-fx-data-shared-prod.firefox_desktop_stable.newtab_v1.schema.json index f92203d43d..8ada2b2b96 100644 --- a/tests/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/moz-fx-data-shared-prod.firefox_desktop_stable.newtab_v1.schema.json +++ b/tests/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/moz-fx-data-shared-prod.firefox_desktop_stable.newtab_v1.schema.json @@ -440,6 +440,11 @@ "name": "topsites_rows", "type": "INTEGER", "mode": "NULLABLE" + }, + { + "name": "topsites_sponsored_tiles_configured", + "type": "INTEGER", + "mode": "NULLABLE" } ] }, diff --git a/tests/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/test_aggregation/expect.yaml b/tests/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/test_aggregation/expect.yaml index e7addb8a7c..4869191155 100644 --- a/tests/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/test_aggregation/expect.yaml +++ b/tests/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/test_aggregation/expect.yaml @@ -15,6 +15,7 @@ newtab_default_ui: default newtab_newtab_category: enabled profile_group_id: profile_group_id_1 + topsites_sponsored_tiles_configured: 2 search_interactions: - search_engine: Engine1 search_access_point: urlbar diff --git a/tests/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/test_aggregation/moz-fx-data-shared-prod.firefox_desktop_stable.newtab_v1.yaml b/tests/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/test_aggregation/moz-fx-data-shared-prod.firefox_desktop_stable.newtab_v1.yaml index 3682507a4f..2d31025456 100644 --- a/tests/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/test_aggregation/moz-fx-data-shared-prod.firefox_desktop_stable.newtab_v1.yaml +++ b/tests/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/test_aggregation/moz-fx-data-shared-prod.firefox_desktop_stable.newtab_v1.yaml @@ -8,6 +8,8 @@ legacy_telemetry_profile_group_id: profile_group_id_1 string: newtab_newtab_category: enabled + quantity: + topsites_sponsored_tiles_configured: 2 events: - category: newtab name: opened