Add 1 more column to downloads_v2 (#5861)

* Add new column 'campaign_from_event_params' to schema.yaml

* Updated query
This commit is contained in:
Katie Windau 2024-06-27 16:09:57 -05:00 коммит произвёл GitHub
Родитель b8bee8b138
Коммит 3c393f27dd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 18 добавлений и 1 удалений

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

@ -16,6 +16,7 @@ WITH staging AS (
campaign,
ad_content,
browser,
campaign_from_event_params,
--note: the 2 columns are the same because in GA4, there is no logic saying you can only count 1 download per session, unlike GA3
COUNTIF(
--prior to and including 2/16/24
@ -58,6 +59,16 @@ WITH staging AS (
collected_traffic_source.manual_content AS ad_content,
device.web_info.browser AS browser,
event_name,
(
SELECT
`value`
FROM
UNNEST(event_params)
WHERE
key = 'campaign'
LIMIT
1
).string_value AS campaign_from_event_params,
(
SELECT
`value`
@ -103,7 +114,8 @@ WITH staging AS (
medium,
campaign,
ad_content,
browser
browser,
campaign_from_event_params
)
SELECT
`date`,
@ -121,6 +133,7 @@ SELECT
medium,
campaign,
ad_content,
campaign_from_event_params,
browser,
download_events,
download_events AS downloads,

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

@ -63,6 +63,10 @@ fields:
name: browser
type: STRING
description: Browser
- mode: NULLABLE
name: campaign_from_event_params
type: STRING
description: Campaign - Parsed from nested event_params key = campaign
- mode: NULLABLE
name: download_events
type: INT64