Update bqetl_google_analytics_derived_ga4 yaml configs (#4780)

* Update bqetl_google_analytics_derived_ga4 yaml configs

* Switch to using countifs for more readability

* reformat and switch to countifs for readability
This commit is contained in:
Katie Windau 2024-01-04 15:44:28 -06:00 коммит произвёл GitHub
Родитель 6220025220
Коммит 1c4102abed
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 12 добавлений и 18 удалений

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

@ -1439,13 +1439,15 @@ bqetl_desktop_installs_v1:
bqetl_google_analytics_derived_ga4:
schedule_interval: 0 12 * * *
description: |
Daily aggregations of data exported from Google Analytics 4
description: Daily aggregations of data exported from Google Analytics 4
default_args:
depends_on_past: false
owner: kwindau@mozilla.com
email:
- kwindau@mozilla.com
- telemetry-alerts@mozilla.com
email_on_failure: true
email_on_retry: false
start_date: "2024-01-03"
retries: 2
retry_delay: 30m

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

@ -11,22 +11,14 @@ WITH site_data AS (
collected_traffic_source.manual_campaign_name AS campaign,
collected_traffic_source.manual_content AS ad_content,
COUNTIF(event_name = 'session_start') AS sessions,
SUM(
CASE
WHEN event_name = 'session_start'
AND NOT `moz-fx-data-shared-prod.udf.ga_is_mozilla_browser`(device.web_info.browser)
THEN 1
ELSE 0
END
COUNTIF(
event_name = 'session_start'
AND NOT `moz-fx-data-shared-prod.udf.ga_is_mozilla_browser`(device.web_info.browser)
) AS non_fx_sessions,
SUM(CASE WHEN event_name = 'product_download' THEN 1 ELSE 0 END) AS downloads,
SUM(
CASE
WHEN event_name = 'product_download'
AND NOT `moz-fx-data-shared-prod.udf.ga_is_mozilla_browser`(device.web_info.browser)
THEN 1
ELSE 0
END
COUNTIF(event_name = 'product_download') AS downloads,
COUNTIF(
event_name = 'product_download'
AND NOT `moz-fx-data-shared-prod.udf.ga_is_mozilla_browser`(device.web_info.browser)
) AS non_fx_downloads
FROM
`moz-fx-data-marketing-prod.analytics_313696158.events_*`
@ -55,7 +47,7 @@ SELECT
s.source,
s.medium,
s.campaign,
s.ad_content,
s.ad_content,
s.sessions,
s.non_fx_sessions,
s.downloads,