Skip to content

Commit

Permalink
update telemetry for list cards (#6445)
Browse files Browse the repository at this point in the history
* update telemetry for list cards

* update test yaml

* fix incorrect bool

---------

Co-authored-by: Chelsey Beck <[email protected]>
  • Loading branch information
m-d-bowerman and chelseybeck authored Nov 5, 2024
1 parent 4ad4c6b commit 221f44c
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ pocket_data AS (
SUM(pocket_thumbs_up) AS pocket_thumbs_up,
SUM(pocket_thumbs_down) AS pocket_thumbs_down,
SUM(pocket_thumbs_down) + SUM(pocket_thumbs_up) AS pocket_thumb_voting_events,
SUM(list_card_clicks) AS list_card_clicks,
SUM(organic_list_card_clicks) AS organic_list_card_clicks,
SUM(sponsored_list_card_clicks) AS sponsored_list_card_clicks,
SUM(list_card_impressions) AS list_card_impressions,
SUM(organic_list_card_impressions) AS organic_list_card_impressions,
SUM(sponsored_list_card_impressions) AS sponsored_list_card_impressions,
SUM(list_card_saves) AS list_card_saves,
SUM(organic_list_card_saves) AS organic_list_card_saves,
SUM(sponsored_list_card_saves) AS sponsored_list_card_saves,
SUM(list_card_dismissals) AS list_card_dismissals,
SUM(organic_list_card_dismissals) AS organic_list_card_dismissals,
SUM(sponsored_list_card_dismissals) AS sponsored_list_card_dismissals,
FROM
visits_data_base
CROSS JOIN
Expand Down Expand Up @@ -314,7 +326,19 @@ joined AS (
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.topsites_sponsored_tiles_configured AS topsites_sponsored_tiles_configured
visits_data.topsites_sponsored_tiles_configured AS topsites_sponsored_tiles_configured,
COALESCE(pocket_data.list_card_clicks, 0) AS list_card_clicks,
COALESCE(pocket_data.organic_list_card_clicks, 0) AS organic_list_card_clicks,
COALESCE(pocket_data.sponsored_list_card_clicks, 0) AS sponsored_list_card_clicks,
COALESCE(pocket_data.list_card_impressions, 0) AS list_card_impressions,
COALESCE(pocket_data.organic_list_card_impressions, 0) AS organic_list_card_impressions,
COALESCE(pocket_data.sponsored_list_card_impressions, 0) AS sponsored_list_card_impressions,
COALESCE(pocket_data.list_card_saves, 0) AS list_card_saves,
COALESCE(pocket_data.organic_list_card_saves, 0) AS organic_list_card_saves,
COALESCE(pocket_data.sponsored_list_card_saves, 0) AS sponsored_list_card_saves,
COALESCE(pocket_data.list_card_dismissals, 0) AS list_card_dismissals,
COALESCE(pocket_data.organic_list_card_dismissals, 0) AS organic_list_card_dismissals,
COALESCE(pocket_data.sponsored_list_card_dismissals, 0) AS sponsored_list_card_dismissals,
FROM
visits_data
LEFT JOIN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,39 @@ fields:
- name: newtab_dismissal_count
type: INTEGER
mode: NULLABLE
- name: list_card_clicks
type: INTEGER
mode: NULLABLE
- name: organic_list_card_clicks
type: INTEGER
mode: NULLABLE
- name: sponsored_list_card_clicks
type: INTEGER
mode: NULLABLE
- name: list_card_impressions
type: INTEGER
mode: NULLABLE
- name: organic_list_card_impressions
type: INTEGER
mode: NULLABLE
- name: sponsored_list_card_impressions
type: INTEGER
mode: NULLABLE
- name: list_card_saves
type: INTEGER
mode: NULLABLE
- name: organic_list_card_saves
type: INTEGER
mode: NULLABLE
- name: sponsored_list_card_saves
type: INTEGER
mode: NULLABLE
- name: list_card_dismissals
type: INTEGER
mode: NULLABLE
- name: organic_list_card_dismissals
type: INTEGER
mode: NULLABLE
- name: sponsored_list_card_dismissals
type: INTEGER
mode: NULLABLE
Original file line number Diff line number Diff line change
Expand Up @@ -232,40 +232,57 @@ pocket_events AS (
SAFE_CAST(mozfun.map.get_key(event_details, "position") AS INT64) AS pocket_story_position,
mozfun.map.get_key(event_details, "tile_id") AS pocket_tile_id,
mozfun.map.get_key(event_details, "recommendation_id") AS pocket_recommendation_id,
COUNTIF(event_name = 'save') AS pocket_saves,
COUNTIF(event_name = 'click') AS pocket_clicks,
COUNTIF(event_name = 'impression') AS pocket_impressions,
COUNTIF(
event_name = 'save'
AND mozfun.map.get_key(event_details, "is_list_card") != "true"
) AS pocket_saves,
COUNTIF(
event_name = 'click'
AND mozfun.map.get_key(event_details, "is_list_card") != "true"
) AS pocket_clicks,
COUNTIF(
event_name = 'impression'
AND mozfun.map.get_key(event_details, "is_list_card") != "true"
) AS pocket_impressions,
COUNTIF(
event_name = 'click'
AND mozfun.map.get_key(event_details, "is_sponsored") = "true"
AND mozfun.map.get_key(event_details, "is_list_card") != "true"
) AS sponsored_pocket_clicks,
COUNTIF(
event_name = 'click'
AND mozfun.map.get_key(event_details, "is_sponsored") != "true"
AND mozfun.map.get_key(event_details, "is_list_card") != "true"
) AS organic_pocket_clicks,
COUNTIF(
event_name = 'impression'
AND mozfun.map.get_key(event_details, "is_sponsored") = "true"
AND mozfun.map.get_key(event_details, "is_list_card") != "true"
) AS sponsored_pocket_impressions,
COUNTIF(
event_name = 'impression'
AND mozfun.map.get_key(event_details, "is_sponsored") != "true"
AND mozfun.map.get_key(event_details, "is_list_card") != "true"
) AS organic_pocket_impressions,
COUNTIF(
event_name = 'save'
AND mozfun.map.get_key(event_details, "is_sponsored") = "true"
AND mozfun.map.get_key(event_details, "is_list_card") != "true"
) AS sponsored_pocket_saves,
COUNTIF(
event_name = 'save'
AND mozfun.map.get_key(event_details, "is_sponsored") != "true"
AND mozfun.map.get_key(event_details, "is_list_card") != "true"
) AS organic_pocket_saves,
COUNTIF(
event_name = 'dismiss'
AND mozfun.map.get_key(event_details, "is_sponsored") = "true"
AND mozfun.map.get_key(event_details, "is_list_card") != "true"
) AS sponsored_pocket_dismissals,
COUNTIF(
event_name = 'dismiss'
AND mozfun.map.get_key(event_details, "is_sponsored") != "true"
AND mozfun.map.get_key(event_details, "is_list_card") != "true"
) AS organic_pocket_dismissals,
COUNTIF(
event_name = 'thumb_voting_interaction'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
value: 1
- key: is_sponsored
value: false
- key: is_list_card
value: false
- category: newtab
name: wallpaper_click
extra:
Expand Down

1 comment on commit 221f44c

@dataops-ci-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration report for "update telemetry for list cards (#6445)"

sql.diff

Click to expand!
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_focus_derived/baseline_clients_last_seen_v1/bigconfig.yml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_focus_derived/baseline_clients_last_seen_v1/bigconfig.yml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_focus_derived/baseline_clients_last_seen_v1/bigconfig.yml	2024-11-05 23:39:19.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_focus_derived/baseline_clients_last_seen_v1/bigconfig.yml	2024-11-05 23:43:06.000000000 +0000
@@ -6,13 +6,31 @@
     metrics:
     - metric_type:
         type: PREDEFINED
-        predefined_metric: FRESHNESS [warn]
+        predefined_metric: UNDEFINED
       metric_schedule:
         named_schedule:
           name: Default Schedule - 13:00 UTC
     - metric_type:
         type: PREDEFINED
-        predefined_metric: VOLUME [fail]
+        predefined_metric: UNDEFINED
+      metric_schedule:
+        named_schedule:
+          name: Default Schedule - 13:00 UTC
+- deployments:
+  - column_selectors:
+    - name: moz-fx-data-shared-prod.moz-fx-data-shared-prod.org_mozilla_ios_focus_derived.baseline_clients_last_seen_v1.*
+    metrics:
+    - metric_type:
+        type: PREDEFINED
+        predefined_metric: FRESHNESS
+      metric_name: FRESHNESS [warn]
+      metric_schedule:
+        named_schedule:
+          name: Default Schedule - 13:00 UTC
+    - metric_type:
+        type: PREDEFINED
+        predefined_metric: VOLUME
+      metric_name: VOLUME [fail]
       metric_schedule:
         named_schedule:
           name: Default Schedule - 13:00 UTC
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/query.sql	2024-11-05 23:39:20.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/query.sql	2024-11-05 23:39:19.000000000 +0000
@@ -153,6 +153,18 @@
     SUM(pocket_thumbs_up) AS pocket_thumbs_up,
     SUM(pocket_thumbs_down) AS pocket_thumbs_down,
     SUM(pocket_thumbs_down) + SUM(pocket_thumbs_up) AS pocket_thumb_voting_events,
+    SUM(list_card_clicks) AS list_card_clicks,
+    SUM(organic_list_card_clicks) AS organic_list_card_clicks,
+    SUM(sponsored_list_card_clicks) AS sponsored_list_card_clicks,
+    SUM(list_card_impressions) AS list_card_impressions,
+    SUM(organic_list_card_impressions) AS organic_list_card_impressions,
+    SUM(sponsored_list_card_impressions) AS sponsored_list_card_impressions,
+    SUM(list_card_saves) AS list_card_saves,
+    SUM(organic_list_card_saves) AS organic_list_card_saves,
+    SUM(sponsored_list_card_saves) AS sponsored_list_card_saves,
+    SUM(list_card_dismissals) AS list_card_dismissals,
+    SUM(organic_list_card_dismissals) AS organic_list_card_dismissals,
+    SUM(sponsored_list_card_dismissals) AS sponsored_list_card_dismissals,
   FROM
     visits_data_base
   CROSS JOIN
@@ -314,7 +326,19 @@
     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.topsites_sponsored_tiles_configured AS topsites_sponsored_tiles_configured
+    visits_data.topsites_sponsored_tiles_configured AS topsites_sponsored_tiles_configured,
+    COALESCE(pocket_data.list_card_clicks, 0) AS list_card_clicks,
+    COALESCE(pocket_data.organic_list_card_clicks, 0) AS organic_list_card_clicks,
+    COALESCE(pocket_data.sponsored_list_card_clicks, 0) AS sponsored_list_card_clicks,
+    COALESCE(pocket_data.list_card_impressions, 0) AS list_card_impressions,
+    COALESCE(pocket_data.organic_list_card_impressions, 0) AS organic_list_card_impressions,
+    COALESCE(pocket_data.sponsored_list_card_impressions, 0) AS sponsored_list_card_impressions,
+    COALESCE(pocket_data.list_card_saves, 0) AS list_card_saves,
+    COALESCE(pocket_data.organic_list_card_saves, 0) AS organic_list_card_saves,
+    COALESCE(pocket_data.sponsored_list_card_saves, 0) AS sponsored_list_card_saves,
+    COALESCE(pocket_data.list_card_dismissals, 0) AS list_card_dismissals,
+    COALESCE(pocket_data.organic_list_card_dismissals, 0) AS organic_list_card_dismissals,
+    COALESCE(pocket_data.sponsored_list_card_dismissals, 0) AS sponsored_list_card_dismissals,
   FROM
     visits_data
   LEFT JOIN
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/schema.yaml	2024-11-05 23:39:20.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_clients_daily_v1/schema.yaml	2024-11-05 23:39:19.000000000 +0000
@@ -269,3 +269,39 @@
 - name: newtab_dismissal_count
   type: INTEGER
   mode: NULLABLE
+- name: list_card_clicks
+  type: INTEGER
+  mode: NULLABLE
+- name: organic_list_card_clicks
+  type: INTEGER
+  mode: NULLABLE
+- name: sponsored_list_card_clicks
+  type: INTEGER
+  mode: NULLABLE
+- name: list_card_impressions
+  type: INTEGER
+  mode: NULLABLE
+- name: organic_list_card_impressions
+  type: INTEGER
+  mode: NULLABLE
+- name: sponsored_list_card_impressions
+  type: INTEGER
+  mode: NULLABLE
+- name: list_card_saves
+  type: INTEGER
+  mode: NULLABLE
+- name: organic_list_card_saves
+  type: INTEGER
+  mode: NULLABLE
+- name: sponsored_list_card_saves
+  type: INTEGER
+  mode: NULLABLE
+- name: list_card_dismissals
+  type: INTEGER
+  mode: NULLABLE
+- name: organic_list_card_dismissals
+  type: INTEGER
+  mode: NULLABLE
+- name: sponsored_list_card_dismissals
+  type: INTEGER
+  mode: NULLABLE
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/query.sql	2024-11-05 23:39:20.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/newtab_visits_v1/query.sql	2024-11-05 23:39:19.000000000 +0000
@@ -232,40 +232,57 @@
     SAFE_CAST(mozfun.map.get_key(event_details, "position") AS INT64) AS pocket_story_position,
     mozfun.map.get_key(event_details, "tile_id") AS pocket_tile_id,
     mozfun.map.get_key(event_details, "recommendation_id") AS pocket_recommendation_id,
-    COUNTIF(event_name = 'save') AS pocket_saves,
-    COUNTIF(event_name = 'click') AS pocket_clicks,
-    COUNTIF(event_name = 'impression') AS pocket_impressions,
+    COUNTIF(
+      event_name = 'save'
+      AND mozfun.map.get_key(event_details, "is_list_card") != "true"
+    ) AS pocket_saves,
+    COUNTIF(
+      event_name = 'click'
+      AND mozfun.map.get_key(event_details, "is_list_card") != "true"
+    ) AS pocket_clicks,
+    COUNTIF(
+      event_name = 'impression'
+      AND mozfun.map.get_key(event_details, "is_list_card") != "true"
+    ) AS pocket_impressions,
     COUNTIF(
       event_name = 'click'
       AND mozfun.map.get_key(event_details, "is_sponsored") = "true"
+      AND mozfun.map.get_key(event_details, "is_list_card") != "true"
     ) AS sponsored_pocket_clicks,
     COUNTIF(
       event_name = 'click'
       AND mozfun.map.get_key(event_details, "is_sponsored") != "true"
+      AND mozfun.map.get_key(event_details, "is_list_card") != "true"
     ) AS organic_pocket_clicks,
     COUNTIF(
       event_name = 'impression'
       AND mozfun.map.get_key(event_details, "is_sponsored") = "true"
+      AND mozfun.map.get_key(event_details, "is_list_card") != "true"
     ) AS sponsored_pocket_impressions,
     COUNTIF(
       event_name = 'impression'
       AND mozfun.map.get_key(event_details, "is_sponsored") != "true"
+      AND mozfun.map.get_key(event_details, "is_list_card") != "true"
     ) AS organic_pocket_impressions,
     COUNTIF(
       event_name = 'save'
       AND mozfun.map.get_key(event_details, "is_sponsored") = "true"
+      AND mozfun.map.get_key(event_details, "is_list_card") != "true"
     ) AS sponsored_pocket_saves,
     COUNTIF(
       event_name = 'save'
       AND mozfun.map.get_key(event_details, "is_sponsored") != "true"
+      AND mozfun.map.get_key(event_details, "is_list_card") != "true"
     ) AS organic_pocket_saves,
     COUNTIF(
       event_name = 'dismiss'
       AND mozfun.map.get_key(event_details, "is_sponsored") = "true"
+      AND mozfun.map.get_key(event_details, "is_list_card") != "true"
     ) AS sponsored_pocket_dismissals,
     COUNTIF(
       event_name = 'dismiss'
       AND mozfun.map.get_key(event_details, "is_sponsored") != "true"
+      AND mozfun.map.get_key(event_details, "is_list_card") != "true"
     ) AS organic_pocket_dismissals,
     COUNTIF(
       event_name = 'thumb_voting_interaction'

Link to full diff

Please sign in to comment.