Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 1 more column to downloads_v2 #5861

Merged
merged 4 commits into from
Jun 27, 2024
Merged

Add 1 more column to downloads_v2 #5861

merged 4 commits into from
Jun 27, 2024

Conversation

kwindau
Copy link
Contributor

@kwindau kwindau commented Jun 27, 2024

Checklist for reviewer:

  • Commits should reference a bug or github issue, if relevant (if a bug is referenced, the pull request should include the bug number in the title).
  • If the PR comes from a fork, trigger integration CI tests by running the Push to upstream workflow and provide the <username>:<branch> of the fork as parameter. The parameter will also show up
    in the logs of the manual-trigger-required-for-fork CI task together with more detailed instructions.
  • If adding a new field to a query, ensure that the schema and dependent downstream schemas have been updated.
  • When adding a new derived dataset, ensure that data is not available already (fully or partially) and recommend extending an existing dataset in favor of creating new ones. Data can be available in the bigquery-etl repository, looker-hub or in looker-spoke-default.

For modifications to schemas in restricted namespaces (see CODEOWNERS):

┆Issue is synchronized with this Jira Task

@kwindau kwindau enabled auto-merge (squash) June 27, 2024 20:41
@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot
Copy link

Integration report for "Merge branch 'main' into add-col-to-downloads"

sql.diff

Click to expand!
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-marketing-prod/ga_derived/www_site_downloads_v2/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-marketing-prod/ga_derived/www_site_downloads_v2/query.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-marketing-prod/ga_derived/www_site_downloads_v2/query.sql	2024-06-27 20:54:47.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-marketing-prod/ga_derived/www_site_downloads_v2/query.sql	2024-06-27 20:54:54.000000000 +0000
@@ -16,6 +16,7 @@
     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
@@ -64,6 +65,16 @@
           FROM
             UNNEST(event_params)
           WHERE
+            key = 'campaign'
+          LIMIT
+            1
+        ).string_value AS campaign_from_event_params,
+        (
+          SELECT
+            `value`
+          FROM
+            UNNEST(event_params)
+          WHERE
             key = 'product'
           LIMIT
             1
@@ -103,7 +114,8 @@
     medium,
     campaign,
     ad_content,
-    browser
+    browser,
+    campaign_from_event_params
 )
 SELECT
   `date`,
@@ -121,6 +133,7 @@
   medium,
   campaign,
   ad_content,
+  campaign_from_event_params,
   browser,
   download_events,
   download_events AS downloads,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-marketing-prod/ga_derived/www_site_downloads_v2/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-marketing-prod/ga_derived/www_site_downloads_v2/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-marketing-prod/ga_derived/www_site_downloads_v2/schema.yaml	2024-06-27 20:54:47.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-marketing-prod/ga_derived/www_site_downloads_v2/schema.yaml	2024-06-27 20:54:54.000000000 +0000
@@ -64,6 +64,10 @@
   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
   description: Download Events - Number of Firefox Desktop Downloads

Link to full diff

@kwindau kwindau merged commit 3c393f2 into main Jun 27, 2024
20 checks passed
@kwindau kwindau deleted the add-col-to-downloads branch June 27, 2024 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants