Add distribution_id to feature_usage_events_v1 (#6277)

* add distribution_id from client_attribution

* add sponsored tiles usage

* Update sql/moz-fx-data-shared-prod/fenix_derived/feature_usage_events_v1/query.sql

Co-authored-by: kik-kik <42538694+kik-kik@users.noreply.github.com>

* Update sql/moz-fx-data-shared-prod/fenix_derived/feature_usage_events_v1/query.sql

Co-authored-by: kik-kik <42538694+kik-kik@users.noreply.github.com>

* reorder grouping key

* date of distribution_id addition to metadata

---------

Co-authored-by: kik-kik <42538694+kik-kik@users.noreply.github.com>
This commit is contained in:
m-d-bowerman 2024-10-08 07:02:02 -07:00 коммит произвёл GitHub
Родитель 9475778423
Коммит af8583ccb9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 51 добавлений и 4 удалений

Просмотреть файл

@ -1,6 +1,8 @@
friendly_name: Feature Usage Events (Android - Fenix)
description: |-
Metrics from events pings for mobile feature usage dashboards (Fenix)
Metrics from events pings for mobile feature usage dashboards (Fenix).
`distribution_id` was added as a dimension to this table beginning on
2024-10-08.
owners:
- rzhao@mozilla.com
labels:

Просмотреть файл

@ -30,6 +30,7 @@ client_attribution AS (
client_id,
channel,
adjust_network,
distribution_id,
FROM
`moz-fx-data-shared-prod.fenix.firefox_android_clients`
),
@ -330,7 +331,15 @@ event_ping_clients_feature_usage AS (
COUNTIF(
event_category = 'home_screen'
AND event_name = 'customize_home_clicked'
) AS home_page_customize_home_clicked
) AS home_page_customize_home_clicked,
COUNTIF(
event_category = 'top_sites'
AND event_name = 'contile_click'
) AS top_sites_contile_click,
COUNTIF(
event_category = 'top_sites'
AND event_name = 'contile_impression'
) AS top_sites_contile_impression,
FROM
`moz-fx-data-shared-prod.fenix.events_unnested`
WHERE
@ -353,6 +362,7 @@ SELECT
country,
adjust_network,
is_default_browser,
distribution_id,
/*Logins*/
--autofill_prompt_shown
SUM(autofill_password_detected_logins) AS autofill_password_detected_logins,
@ -938,7 +948,26 @@ SELECT
WHEN home_page_customize_home_clicked > 0
THEN client_id
END
) AS home_page_customize_home_clicked_users
) AS home_page_customize_home_clicked_users,
/*Sponsored Tiles*/
--top_sites_contile_click
SUM(top_sites_contile_click) AS top_sites_contile_click,
COUNT(
DISTINCT
CASE
WHEN top_sites_contile_click > 0
THEN client_id
END
) AS top_sites_contile_click_users,
--top_sites_contile_impression
SUM(top_sites_contile_impression) AS top_sites_contile_impression,
COUNT(
DISTINCT
CASE
WHEN top_sites_contile_impression > 0
THEN client_id
END
) AS top_sites_contile_impression_users,
FROM
event_ping_clients_feature_usage
INNER JOIN
@ -956,4 +985,5 @@ GROUP BY
channel,
country,
adjust_network,
is_default_browser
is_default_browser,
distribution_id

Просмотреть файл

@ -521,3 +521,18 @@ fields:
- name: home_page_customize_home_clicked_users
type: INTEGER
mode: NULLABLE
- name: distribution_id
type: STRING
mode: NULLABLE
- name: top_sites_contile_click
type: INTEGER
mode: NULLABLE
- name: top_sites_contile_click_users
type: INTEGER
mode: NULLABLE
- name: top_sites_contile_impression
type: INTEGER
mode: NULLABLE
- name: top_sites_contile_impression_users
type: INTEGER
mode: NULLABLE