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

Create iOS_onboarding.toml #6316

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

rhythmofrain63
Copy link
Contributor

@rhythmofrain63 rhythmofrain63 commented Oct 9, 2024

Added iOS_onboarding.toml - query for generating the underlying table in the iOS onboarding dashboard.

Description

Related Tickets & Documents

  • DENG-XXXX
  • DSRE-XXXX

Reviewer, please follow this checklist

┆Issue is synchronized with this Jira Task

Added iOS_onboarding.toml - query for generating the underlying table in the iOS onboarding dashboard.
@dataops-ci-bot

This comment has been minimized.

from_expression = """
firefox_ios.firefox_ios_clients ic --each client_id has only one row
LEFT JOIN `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_4_v1 r --each client_id has only one row
ON ic.client_id = r.client_id
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you could also use the more concise USING(client_id) here instead.

@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot
Copy link

Integration report for "feat: remove locale from dimension list, it does not exist in the source table"

sql.diff

Click to expand!
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_firefox_ios.py /tmp/workspace/generated-sql/dags/bqetl_firefox_ios.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_firefox_ios.py	2024-10-11 14:26:13.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_firefox_ios.py	2024-10-11 14:38:05.000000000 +0000
@@ -258,6 +258,13 @@
         )
 
         ExternalTaskMarker(
+            task_id="bqetl_generated_funnels__wait_for_checks__fail_firefox_ios_derived__clients_activation__v1",
+            external_dag_id="bqetl_generated_funnels",
+            external_task_id="wait_for_checks__fail_firefox_ios_derived__clients_activation__v1",
+            execution_date="{{ (execution_date - macros.timedelta(days=-1, seconds=82800)).isoformat() }}",
+        )
+
+        ExternalTaskMarker(
             task_id="bqetl_org_mozilla_firefox_derived__wait_for_checks__fail_firefox_ios_derived__clients_activation__v1",
             external_dag_id="bqetl_org_mozilla_firefox_derived",
             external_task_id="wait_for_checks__fail_firefox_ios_derived__clients_activation__v1",
@@ -307,6 +314,13 @@
         )
 
         ExternalTaskMarker(
+            task_id="bqetl_generated_funnels__wait_for_checks__fail_firefox_ios_derived__firefox_ios_clients__v1",
+            external_dag_id="bqetl_generated_funnels",
+            external_task_id="wait_for_checks__fail_firefox_ios_derived__firefox_ios_clients__v1",
+            execution_date="{{ (execution_date - macros.timedelta(days=-1, seconds=82800)).isoformat() }}",
+        )
+
+        ExternalTaskMarker(
             task_id="bqetl_org_mozilla_firefox_derived__wait_for_checks__fail_firefox_ios_derived__firefox_ios_clients__v1",
             external_dag_id="bqetl_org_mozilla_firefox_derived",
             external_task_id="wait_for_checks__fail_firefox_ios_derived__firefox_ios_clients__v1",
@@ -522,6 +536,20 @@
         depends_on_past=False,
     )
 
+    with TaskGroup(
+        "firefox_ios_derived__funnel_retention_clients_week_2__v1_external",
+    ) as firefox_ios_derived__funnel_retention_clients_week_2__v1_external:
+        ExternalTaskMarker(
+            task_id="bqetl_generated_funnels__wait_for_firefox_ios_derived__funnel_retention_clients_week_2__v1",
+            external_dag_id="bqetl_generated_funnels",
+            external_task_id="wait_for_firefox_ios_derived__funnel_retention_clients_week_2__v1",
+            execution_date="{{ (execution_date - macros.timedelta(days=-1, seconds=82800)).isoformat() }}",
+        )
+
+        firefox_ios_derived__funnel_retention_clients_week_2__v1_external.set_upstream(
+            firefox_ios_derived__funnel_retention_clients_week_2__v1
+        )
+
     firefox_ios_derived__funnel_retention_clients_week_4__v1 = bigquery_etl_query(
         task_id="firefox_ios_derived__funnel_retention_clients_week_4__v1",
         destination_table="funnel_retention_clients_week_4_v1",
@@ -533,6 +561,20 @@
         depends_on_past=False,
     )
 
+    with TaskGroup(
+        "firefox_ios_derived__funnel_retention_clients_week_4__v1_external",
+    ) as firefox_ios_derived__funnel_retention_clients_week_4__v1_external:
+        ExternalTaskMarker(
+            task_id="bqetl_generated_funnels__wait_for_firefox_ios_derived__funnel_retention_clients_week_4__v1",
+            external_dag_id="bqetl_generated_funnels",
+            external_task_id="wait_for_firefox_ios_derived__funnel_retention_clients_week_4__v1",
+            execution_date="{{ (execution_date - macros.timedelta(days=-1, seconds=82800)).isoformat() }}",
+        )
+
+        firefox_ios_derived__funnel_retention_clients_week_4__v1_external.set_upstream(
+            firefox_ios_derived__funnel_retention_clients_week_4__v1
+        )
+
     firefox_ios_derived__funnel_retention_week_4__v1 = bigquery_etl_query(
         task_id="firefox_ios_derived__funnel_retention_week_4__v1",
         destination_table="funnel_retention_week_4_v1",
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_generated_funnels.py /tmp/workspace/generated-sql/dags/bqetl_generated_funnels.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_generated_funnels.py	2024-10-11 14:26:13.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_generated_funnels.py	2024-10-11 14:38:07.000000000 +0000
@@ -150,6 +150,60 @@
         pool="DATA_ENG_EXTERNALTASKSENSOR",
     )
 
+    wait_for_checks__fail_firefox_ios_derived__clients_activation__v1 = (
+        ExternalTaskSensor(
+            task_id="wait_for_checks__fail_firefox_ios_derived__clients_activation__v1",
+            external_dag_id="bqetl_firefox_ios",
+            external_task_id="checks__fail_firefox_ios_derived__clients_activation__v1",
+            execution_delta=datetime.timedelta(seconds=3600),
+            check_existence=True,
+            mode="reschedule",
+            allowed_states=ALLOWED_STATES,
+            failed_states=FAILED_STATES,
+            pool="DATA_ENG_EXTERNALTASKSENSOR",
+        )
+    )
+
+    wait_for_checks__fail_firefox_ios_derived__firefox_ios_clients__v1 = ExternalTaskSensor(
+        task_id="wait_for_checks__fail_firefox_ios_derived__firefox_ios_clients__v1",
+        external_dag_id="bqetl_firefox_ios",
+        external_task_id="checks__fail_firefox_ios_derived__firefox_ios_clients__v1",
+        execution_delta=datetime.timedelta(seconds=3600),
+        check_existence=True,
+        mode="reschedule",
+        allowed_states=ALLOWED_STATES,
+        failed_states=FAILED_STATES,
+        pool="DATA_ENG_EXTERNALTASKSENSOR",
+    )
+
+    wait_for_firefox_ios_derived__funnel_retention_clients_week_2__v1 = (
+        ExternalTaskSensor(
+            task_id="wait_for_firefox_ios_derived__funnel_retention_clients_week_2__v1",
+            external_dag_id="bqetl_firefox_ios",
+            external_task_id="firefox_ios_derived__funnel_retention_clients_week_2__v1",
+            execution_delta=datetime.timedelta(seconds=3600),
+            check_existence=True,
+            mode="reschedule",
+            allowed_states=ALLOWED_STATES,
+            failed_states=FAILED_STATES,
+            pool="DATA_ENG_EXTERNALTASKSENSOR",
+        )
+    )
+
+    wait_for_firefox_ios_derived__funnel_retention_clients_week_4__v1 = (
+        ExternalTaskSensor(
+            task_id="wait_for_firefox_ios_derived__funnel_retention_clients_week_4__v1",
+            external_dag_id="bqetl_firefox_ios",
+            external_task_id="firefox_ios_derived__funnel_retention_clients_week_4__v1",
+            execution_delta=datetime.timedelta(seconds=3600),
+            check_existence=True,
+            mode="reschedule",
+            allowed_states=ALLOWED_STATES,
+            failed_states=FAILED_STATES,
+            pool="DATA_ENG_EXTERNALTASKSENSOR",
+        )
+    )
+
     accounts_frontend_derived__account_pref_delete_funnel__v1 = bigquery_etl_query(
         task_id="accounts_frontend_derived__account_pref_delete_funnel__v1",
         destination_table="account_pref_delete_funnel_v1",
@@ -334,6 +388,21 @@
         )
     )
 
+    firefox_ios_derived__iOS_onboarding__v1 = bigquery_etl_query(
+        task_id="firefox_ios_derived__iOS_onboarding__v1",
+        destination_table="iOS_onboarding_v1",
+        dataset_id="firefox_ios_derived",
+        project_id="moz-fx-data-shared-prod",
+        owner="rzhao@mozilla.org",
+        email=[
+            "ascholtz@mozilla.com",
+            "rzhao@mozilla.org",
+            "telemetry-alerts@mozilla.com",
+        ],
+        date_partition_parameter="submission_date",
+        depends_on_past=False,
+    )
+
     monitor_frontend_derived__monitor_dashboard_user_journey_funnels__v1 = bigquery_etl_query(
         task_id="monitor_frontend_derived__monitor_dashboard_user_journey_funnels__v1",
         destination_table="monitor_dashboard_user_journey_funnels_v1",
@@ -435,6 +504,24 @@
         wait_for_firefox_accounts_derived__fxa_stdout_events__v1
     )
 
+    firefox_ios_derived__iOS_onboarding__v1.set_upstream(
+        wait_for_checks__fail_firefox_ios_derived__clients_activation__v1
+    )
+
+    firefox_ios_derived__iOS_onboarding__v1.set_upstream(
+        wait_for_checks__fail_firefox_ios_derived__firefox_ios_clients__v1
+    )
+
+    firefox_ios_derived__iOS_onboarding__v1.set_upstream(wait_for_copy_deduplicate_all)
+
+    firefox_ios_derived__iOS_onboarding__v1.set_upstream(
+        wait_for_firefox_ios_derived__funnel_retention_clients_week_2__v1
+    )
+
+    firefox_ios_derived__iOS_onboarding__v1.set_upstream(
+        wait_for_firefox_ios_derived__funnel_retention_clients_week_4__v1
+    )
+
     monitor_frontend_derived__monitor_dashboard_user_journey_funnels__v1.set_upstream(
         wait_for_copy_deduplicate_all
     )
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived: iOS_onboarding_v1
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_fennec: dau_reporting
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_firefox: dau_reporting
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_firefoxbeta: dau_reporting
Only in /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/releases: bigconfig.yml
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/accounts_backend_derived/event_monitoring_live_v1/materialized_view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/accounts_backend_derived/event_monitoring_live_v1/materialized_view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/accounts_backend_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:21:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/accounts_backend_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:23:52.000000000 +0000
@@ -67,7 +67,7 @@
   LEFT JOIN
     UNNEST(event.extra) AS event_extra
   WHERE
-    DATE(submission_timestamp) >= "2024-10-10"
+    DATE(submission_timestamp) >= "2024-10-11"
   GROUP BY
     submission_date,
     window_start,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/accounts_cirrus_derived/event_monitoring_live_v1/materialized_view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/accounts_cirrus_derived/event_monitoring_live_v1/materialized_view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/accounts_cirrus_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:21:12.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/accounts_cirrus_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:23:52.000000000 +0000
@@ -67,7 +67,7 @@
   LEFT JOIN
     UNNEST(event.extra) AS event_extra
   WHERE
-    DATE(submission_timestamp) >= "2024-10-10"
+    DATE(submission_timestamp) >= "2024-10-11"
   GROUP BY
     submission_date,
     window_start,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/accounts_frontend_derived/event_monitoring_live_v1/materialized_view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/accounts_frontend_derived/event_monitoring_live_v1/materialized_view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/accounts_frontend_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:21:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/accounts_frontend_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:23:52.000000000 +0000
@@ -67,7 +67,7 @@
   LEFT JOIN
     UNNEST(event.extra) AS event_extra
   WHERE
-    DATE(submission_timestamp) >= "2024-10-10"
+    DATE(submission_timestamp) >= "2024-10-11"
   GROUP BY
     submission_date,
     window_start,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/bedrock_derived/event_monitoring_live_v1/materialized_view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/bedrock_derived/event_monitoring_live_v1/materialized_view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/bedrock_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:21:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/bedrock_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:23:53.000000000 +0000
@@ -87,7 +87,7 @@
   LEFT JOIN
     UNNEST(event.extra) AS event_extra
   WHERE
-    DATE(submission_timestamp) >= "2024-10-10"
+    DATE(submission_timestamp) >= "2024-10-11"
   GROUP BY
     submission_date,
     window_start,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/burnham_derived/event_monitoring_live_v1/materialized_view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/burnham_derived/event_monitoring_live_v1/materialized_view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/burnham_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:21:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/burnham_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:23:53.000000000 +0000
@@ -67,7 +67,7 @@
   LEFT JOIN
     UNNEST(event.extra) AS event_extra
   WHERE
-    DATE(submission_timestamp) >= "2024-10-10"
+    DATE(submission_timestamp) >= "2024-10-11"
   GROUP BY
     submission_date,
     window_start,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/contextual_services/event_aggregates/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/contextual_services/event_aggregates/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/contextual_services/event_aggregates/schema.yaml	2024-10-11 14:20:18.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/contextual_services/event_aggregates/schema.yaml	2024-10-11 14:29:32.000000000 +0000
@@ -1,49 +1,49 @@
 fields:
-- mode: NULLABLE
-  name: submission_date
+- name: submission_date
   type: DATE
-- mode: NULLABLE
-  name: source
+  mode: NULLABLE
+- name: source
   type: STRING
-- mode: NULLABLE
-  name: event_type
+  mode: NULLABLE
+- name: event_type
   type: STRING
-- mode: NULLABLE
-  name: form_factor
+  mode: NULLABLE
+- name: form_factor
   type: STRING
-- mode: NULLABLE
-  name: country
+  mode: NULLABLE
+- name: country
   type: STRING
-- mode: NULLABLE
-  name: subdivision1
+  mode: NULLABLE
+- name: subdivision1
   type: STRING
-- mode: NULLABLE
-  name: advertiser
+  mode: NULLABLE
+- name: advertiser
   type: STRING
-- mode: NULLABLE
-  name: release_channel
+  mode: NULLABLE
+- name: release_channel
   type: STRING
-- mode: NULLABLE
-  name: position
+  mode: NULLABLE
+- name: position
   type: INTEGER
-- mode: NULLABLE
-  name: provider
+  mode: NULLABLE
+- name: provider
   type: STRING
-- mode: NULLABLE
-  name: match_type
+  mode: NULLABLE
+- name: match_type
   type: STRING
-- mode: NULLABLE
-  name: normalized_os
+  mode: NULLABLE
+- name: normalized_os
   type: STRING
-- mode: NULLABLE
-  name: suggest_data_sharing_enabled
+  mode: NULLABLE
+- name: suggest_data_sharing_enabled
   type: BOOLEAN
-- mode: NULLABLE
-  name: event_count
+  mode: NULLABLE
+- name: event_count
   type: INTEGER
-- mode: NULLABLE
-  name: user_count
+  mode: NULLABLE
+- name: user_count
   type: INTEGER
-- mode: NULLABLE
-  name: query_type
+  mode: NULLABLE
+- name: query_type
   type: STRING
+  mode: NULLABLE
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/contextual_services/event_aggregates_suggest/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/contextual_services/event_aggregates_suggest/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/contextual_services/event_aggregates_suggest/schema.yaml	2024-10-11 14:20:18.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/contextual_services/event_aggregates_suggest/schema.yaml	2024-10-11 14:29:17.000000000 +0000
@@ -1,40 +1,40 @@
 fields:
-- mode: NULLABLE
-  name: submission_date
+- name: submission_date
   type: DATE
-- mode: NULLABLE
-  name: form_factor
+  mode: NULLABLE
+- name: form_factor
   type: STRING
-- mode: NULLABLE
-  name: country
+  mode: NULLABLE
+- name: country
   type: STRING
-- mode: NULLABLE
-  name: advertiser
+  mode: NULLABLE
+- name: advertiser
   type: STRING
-- mode: NULLABLE
-  name: normalized_os
+  mode: NULLABLE
+- name: normalized_os
   type: STRING
-- mode: NULLABLE
-  name: release_channel
+  mode: NULLABLE
+- name: release_channel
   type: STRING
-- mode: NULLABLE
-  name: position
+  mode: NULLABLE
+- name: position
   type: INTEGER
-- mode: NULLABLE
-  name: provider
+  mode: NULLABLE
+- name: provider
   type: STRING
-- mode: NULLABLE
-  name: match_type
+  mode: NULLABLE
+- name: match_type
   type: STRING
-- mode: NULLABLE
-  name: suggest_data_sharing_enabled
+  mode: NULLABLE
+- name: suggest_data_sharing_enabled
   type: BOOLEAN
-- mode: NULLABLE
-  name: impression_count
+  mode: NULLABLE
+- name: impression_count
   type: INTEGER
-- mode: NULLABLE
-  name: click_count
+  mode: NULLABLE
+- name: click_count
   type: INTEGER
-- mode: NULLABLE
-  name: query_type
+  mode: NULLABLE
+- name: query_type
   type: STRING
+  mode: NULLABLE
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/debug_ping_view_derived/event_monitoring_live_v1/materialized_view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/debug_ping_view_derived/event_monitoring_live_v1/materialized_view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/debug_ping_view_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:21:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/debug_ping_view_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:23:53.000000000 +0000
@@ -67,7 +67,7 @@
   LEFT JOIN
     UNNEST(event.extra) AS event_extra
   WHERE
-    DATE(submission_timestamp) >= "2024-10-10"
+    DATE(submission_timestamp) >= "2024-10-11"
   GROUP BY
     submission_date,
     window_start,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix/funnel_retention_clients/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix/funnel_retention_clients/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix/funnel_retention_clients/schema.yaml	2024-10-11 14:20:18.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix/funnel_retention_clients/schema.yaml	2024-10-11 14:29:02.000000000 +0000
@@ -26,6 +26,9 @@
 - name: adjust_network
   type: STRING
   mode: NULLABLE
+- name: install_source
+  type: STRING
+  mode: NULLABLE
 - name: retained_week_2
   type: BOOLEAN
   mode: NULLABLE
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix/funnel_retention_week_4/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix/funnel_retention_week_4/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix/funnel_retention_week_4/schema.yaml	2024-10-11 14:20:18.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix/funnel_retention_week_4/schema.yaml	2024-10-11 14:28:58.000000000 +0000
@@ -48,6 +48,10 @@
   description: 'The type of source of a client installation.
 
     '
+- name: install_source
+  type: STRING
+  mode: NULLABLE
+  description: null
 - name: new_profiles
   type: INTEGER
   mode: NULLABLE
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix/metrics/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix/metrics/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix/metrics/schema.yaml	2024-10-11 14:21:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix/metrics/schema.yaml	2024-10-11 14:29:27.000000000 +0000
@@ -11235,6 +11235,82 @@
         - name: value
           type: INTEGER
           mode: NULLABLE
+    - name: networking_sqlite_cookies_block_main_thread
+      type: RECORD
+      mode: NULLABLE
+      fields:
+      - name: bucket_count
+        type: INTEGER
+        mode: NULLABLE
+      - name: count
+        type: INTEGER
+        mode: NULLABLE
+      - name: histogram_type
+        type: STRING
+        mode: NULLABLE
+      - name: overflow
+        type: INTEGER
+        mode: NULLABLE
+      - name: range
+        type: FLOAT
+        mode: REPEATED
+      - name: sum
+        type: INTEGER
+        mode: NULLABLE
+      - name: time_unit
+        type: STRING
+        mode: NULLABLE
+      - name: underflow
+        type: INTEGER
+        mode: NULLABLE
+      - name: values
+        type: RECORD
+        mode: REPEATED
+        fields:
+        - name: key
+          type: STRING
+          mode: NULLABLE
+        - name: value
+          type: INTEGER
+          mode: NULLABLE
+    - name: networking_sqlite_cookies_time_to_block_main_thread
+      type: RECORD
+      mode: NULLABLE
+      fields:
+      - name: bucket_count
+        type: INTEGER
+        mode: NULLABLE
+      - name: count
+        type: INTEGER
+        mode: NULLABLE
+      - name: histogram_type
+        type: STRING
+        mode: NULLABLE
+      - name: overflow
+        type: INTEGER
+        mode: NULLABLE
+      - name: range
+        type: FLOAT
+        mode: REPEATED
+      - name: sum
+        type: INTEGER
+        mode: NULLABLE
+      - name: time_unit
+        type: STRING
+        mode: NULLABLE
+      - name: underflow
+        type: INTEGER
+        mode: NULLABLE
+      - name: values
+        type: RECORD
+        mode: REPEATED
+        fields:
+        - name: key
+          type: STRING
+          mode: NULLABLE
+        - name: value
+          type: INTEGER
+          mode: NULLABLE
   - name: memory_distribution
     type: RECORD
     mode: NULLABLE
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix/metrics/view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix/metrics/view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix/metrics/view.sql	2024-10-11 14:21:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix/metrics/view.sql	2024-10-11 14:26:28.000000000 +0000
@@ -727,7 +727,9 @@
       metrics.timing_distribution.ocsp_request_time_success,
       metrics.timing_distribution.networking_http_content_ondatafinished_delay_2,
       metrics.timing_distribution.ls_preparedatastore_processing_time,
-      metrics.timing_distribution.ls_preparelsdatabase_processing_time
+      metrics.timing_distribution.ls_preparelsdatabase_processing_time,
+      metrics.timing_distribution.networking_sqlite_cookies_block_main_thread,
+      metrics.timing_distribution.networking_sqlite_cookies_time_to_block_main_thread
     ) AS `timing_distribution`,
     STRUCT(
       metrics.memory_distribution.glean_upload_discarded_exceeding_pings_size,
@@ -1567,7 +1569,9 @@
       metrics.timing_distribution.ocsp_request_time_success,
       metrics.timing_distribution.networking_http_content_ondatafinished_delay_2,
       metrics.timing_distribution.ls_preparedatastore_processing_time,
-      metrics.timing_distribution.ls_preparelsdatabase_processing_time
+      metrics.timing_distribution.ls_preparelsdatabase_processing_time,
+      metrics.timing_distribution.networking_sqlite_cookies_block_main_thread,
+      metrics.timing_distribution.networking_sqlite_cookies_time_to_block_main_thread
     ) AS `timing_distribution`,
     STRUCT(
       metrics.memory_distribution.glean_upload_discarded_exceeding_pings_size,
@@ -2425,7 +2429,9 @@
       metrics.timing_distribution.ocsp_request_time_success,
       metrics.timing_distribution.networking_http_content_ondatafinished_delay_2,
       metrics.timing_distribution.ls_preparedatastore_processing_time,
-      metrics.timing_distribution.ls_preparelsdatabase_processing_time
+      metrics.timing_distribution.ls_preparelsdatabase_processing_time,
+      metrics.timing_distribution.networking_sqlite_cookies_block_main_thread,
+      metrics.timing_distribution.networking_sqlite_cookies_time_to_block_main_thread
     ) AS `timing_distribution`,
     STRUCT(
       metrics.memory_distribution.glean_upload_discarded_exceeding_pings_size,
@@ -3292,7 +3298,9 @@
       metrics.timing_distribution.ocsp_request_time_success,
       metrics.timing_distribution.networking_http_content_ondatafinished_delay_2,
       metrics.timing_distribution.ls_preparedatastore_processing_time,
-      metrics.timing_distribution.ls_preparelsdatabase_processing_time
+      metrics.timing_distribution.ls_preparelsdatabase_processing_time,
+      metrics.timing_distribution.networking_sqlite_cookies_block_main_thread,
+      metrics.timing_distribution.networking_sqlite_cookies_time_to_block_main_thread
     ) AS `timing_distribution`,
     STRUCT(
       metrics.memory_distribution.glean_upload_discarded_exceeding_pings_size,
@@ -4141,7 +4149,9 @@
       metrics.timing_distribution.ocsp_request_time_success,
       metrics.timing_distribution.networking_http_content_ondatafinished_delay_2,
       metrics.timing_distribution.ls_preparedatastore_processing_time,
-      metrics.timing_distribution.ls_preparelsdatabase_processing_time
+      metrics.timing_distribution.ls_preparelsdatabase_processing_time,
+      metrics.timing_distribution.networking_sqlite_cookies_block_main_thread,
+      metrics.timing_distribution.networking_sqlite_cookies_time_to_block_main_thread
     ) AS `timing_distribution`,
     STRUCT(
       metrics.memory_distribution.glean_upload_discarded_exceeding_pings_size,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_crashreporter_derived/event_monitoring_live_v1/materialized_view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_crashreporter_derived/event_monitoring_live_v1/materialized_view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_crashreporter_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:21:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_crashreporter_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:23:53.000000000 +0000
@@ -67,7 +67,7 @@
   LEFT JOIN
     UNNEST(event.extra) AS event_extra
   WHERE
-    DATE(submission_timestamp) >= "2024-10-10"
+    DATE(submission_timestamp) >= "2024-10-11"
   GROUP BY
     submission_date,
     window_start,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop/metrics/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop/metrics/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop/metrics/schema.yaml	2024-10-11 14:21:12.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop/metrics/schema.yaml	2024-10-11 14:22:13.000000000 +0000
@@ -10477,6 +10477,94 @@
         when a page begins to load. If an error occurs, the time is not recorded.
 
         '
+    - name: networking_sqlite_cookies_block_main_thread
+      type: RECORD
+      mode: NULLABLE
+      fields:
+      - name: bucket_count
+        type: INTEGER
+        mode: NULLABLE
+      - name: count
+        type: INTEGER
+        mode: NULLABLE
+        description: This was accidentally sent in the past and is now deprecated.
+          See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5
+      - name: histogram_type
+        type: STRING
+        mode: NULLABLE
+      - name: overflow
+        type: INTEGER
+        mode: NULLABLE
+      - name: range
+        type: FLOAT
+        mode: REPEATED
+      - name: sum
+        type: INTEGER
+        mode: NULLABLE
+      - name: time_unit
+        type: STRING
+        mode: NULLABLE
+      - name: underflow
+        type: INTEGER
+        mode: NULLABLE
+      - name: values
+        type: RECORD
+        mode: REPEATED
+        fields:
+        - name: key
+          type: STRING
+          mode: NULLABLE
+        - name: value
+          type: INTEGER
+          mode: NULLABLE
+      description: 'Time spent on blocking main thread by startup cookie database
+        read (in milliseconds), only for blocking case
+
+        '
+    - name: networking_sqlite_cookies_time_to_block_main_thread
+      type: RECORD
+      mode: NULLABLE
+      fields:
+      - name: bucket_count
+        type: INTEGER
+        mode: NULLABLE
+      - name: count
+        type: INTEGER
+        mode: NULLABLE
+        description: This was accidentally sent in the past and is now deprecated.
+          See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5
+      - name: histogram_type
+        type: STRING
+        mode: NULLABLE
+      - name: overflow
+        type: INTEGER
+        mode: NULLABLE
+      - name: range
+        type: FLOAT
+        mode: REPEATED
+      - name: sum
+        type: INTEGER
+        mode: NULLABLE
+      - name: time_unit
+        type: STRING
+        mode: NULLABLE
+      - name: underflow
+        type: INTEGER
+        mode: NULLABLE
+      - name: values
+        type: RECORD
+        mode: REPEATED
+        fields:
+        - name: key
+          type: STRING
+          mode: NULLABLE
+        - name: value
+          type: INTEGER
+          mode: NULLABLE
+      description: 'How long (in milliseconds) after we finished reading the cookie
+        db until the first cookie request came in (0 implies we blocked the main thread)
+
+        '
   - name: quantity
     type: RECORD
     mode: NULLABLE
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_defaultagent_derived/event_monitoring_live_v1/materialized_view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_defaultagent_derived/event_monitoring_live_v1/materialized_view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_defaultagent_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:21:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_defaultagent_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:23:53.000000000 +0000
@@ -67,7 +67,7 @@
   LEFT JOIN
     UNNEST(event.extra) AS event_extra
   WHERE
-    DATE(submission_timestamp) >= "2024-10-10"
+    DATE(submission_timestamp) >= "2024-10-11"
   GROUP BY
     submission_date,
     window_start,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_tasks_derived/event_monitoring_live_v1/materialized_view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_tasks_derived/event_monitoring_live_v1/materialized_view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_tasks_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:21:13.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_tasks_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:23:53.000000000 +0000
@@ -77,7 +77,7 @@
   LEFT JOIN
     UNNEST(event.extra) AS event_extra
   WHERE
-    DATE(submission_timestamp) >= "2024-10-10"
+    DATE(submission_timestamp) >= "2024-10-11"
   GROUP BY
     submission_date,
     window_start,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_update/metrics/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_update/metrics/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_update/metrics/schema.yaml	2024-10-11 14:21:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_update/metrics/schema.yaml	2024-10-11 14:22:17.000000000 +0000
@@ -11578,6 +11578,94 @@
         when a page begins to load. If an error occurs, the time is not recorded.
 
         '
+    - name: networking_sqlite_cookies_block_main_thread
+      type: RECORD
+      mode: NULLABLE
+      fields:
+      - name: bucket_count
+        type: INTEGER
+        mode: NULLABLE
+      - name: count
+        type: INTEGER
+        mode: NULLABLE
+        description: This was accidentally sent in the past and is now deprecated.
+          See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5
+      - name: histogram_type
+        type: STRING
+        mode: NULLABLE
+      - name: overflow
+        type: INTEGER
+        mode: NULLABLE
+      - name: range
+        type: FLOAT
+        mode: REPEATED
+      - name: sum
+        type: INTEGER
+        mode: NULLABLE
+      - name: time_unit
+        type: STRING
+        mode: NULLABLE
+      - name: underflow
+        type: INTEGER
+        mode: NULLABLE
+      - name: values
+        type: RECORD
+        mode: REPEATED
+        fields:
+        - name: key
+          type: STRING
+          mode: NULLABLE
+        - name: value
+          type: INTEGER
+          mode: NULLABLE
+      description: 'Time spent on blocking main thread by startup cookie database
+        read (in milliseconds), only for blocking case
+
+        '
+    - name: networking_sqlite_cookies_time_to_block_main_thread
+      type: RECORD
+      mode: NULLABLE
+      fields:
+      - name: bucket_count
+        type: INTEGER
+        mode: NULLABLE
+      - name: count
+        type: INTEGER
+        mode: NULLABLE
+        description: This was accidentally sent in the past and is now deprecated.
+          See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5
+      - name: histogram_type
+        type: STRING
+        mode: NULLABLE
+      - name: overflow
+        type: INTEGER
+        mode: NULLABLE
+      - name: range
+        type: FLOAT
+        mode: REPEATED
+      - name: sum
+        type: INTEGER
+        mode: NULLABLE
+      - name: time_unit
+        type: STRING
+        mode: NULLABLE
+      - name: underflow
+        type: INTEGER
+        mode: NULLABLE
+      - name: values
+        type: RECORD
+        mode: REPEATED
+        fields:
+        - name: key
+          type: STRING
+          mode: NULLABLE
+        - name: value
+          type: INTEGER
+          mode: NULLABLE
+      description: 'How long (in milliseconds) after we finished reading the cookie
+        db until the first cookie request came in (0 implies we blocked the main thread)
+
+        '
   - name: quantity
     type: RECORD
     mode: NULLABLE
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_update_derived/event_monitoring_live_v1/materialized_view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_update_derived/event_monitoring_live_v1/materialized_view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_update_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:21:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_background_update_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:23:53.000000000 +0000
@@ -67,7 +67,7 @@
   LEFT JOIN
     UNNEST(event.extra) AS event_extra
   WHERE
-    DATE(submission_timestamp) >= "2024-10-10"
+    DATE(submission_timestamp) >= "2024-10-11"
   GROUP BY
     submission_date,
     window_start,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/event_monitoring_live_v1/materialized_view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/event_monitoring_live_v1/materialized_view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:21:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/event_monitoring_live_v1/materialized_view.sql	2024-10-11 14:23:53.000000000 +0000
@@ -107,7 +107,7 @@
   LEFT JOIN
     UNNEST(event.extra) AS event_extra
   WHERE
-    DATE(submission_timestamp) >= "2024-10-10"
+    DATE(submission_timestamp) >= "2024-10-11"
   GROUP BY
     submission_date,
     window_start,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/iOS_onboarding_v1/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/iOS_onboarding_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/iOS_onboarding_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/iOS_onboarding_v1/metadata.yaml	2024-10-11 14:33:19.000000000 +0000
@@ -0,0 +1,29 @@
+friendly_name: Ios Onboarding
+description: |-
+  Please provide a description for the query
+owners:
+- rzhao@mozilla.org
+labels:
+  incremental: true
+  dag: bqetl_generated_funnels
+  owner1: rzhao
+scheduling:
+  dag_name: bqetl_generated_funnels
+bigquery:
+  time_partitioning:
+    type: day
+    field: submission_date
+    require_partition_filter: false
+    expiration_days: null
+  range_partitioning: null
+  clustering: null
+workgroup_access:
+- role: roles/bigquery.dataViewer
+  members:
+  - workgroup:mozilla-confidential
+references:
+  query.sql:
+  - firefox_ios.events_unnested
+  - moz-fx-data-shared-prod.firefox_ios.firefox_ios_clients
+  - moz-fx-data-shared-prod.firefox_ios_derived.funnel_retention_clients_week_2_v1
+  - moz-fx-data-shared-prod.firefox_ios_derived.funnel_retention_clients_week_4_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/iOS_onboarding_v1/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/iOS_onboarding_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/iOS_onboarding_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/iOS_onboarding_v1/query.sql	2024-10-11 14:34:36.000000000 +0000
@@ -0,0 +1,2752 @@
+-- extract the relevant fields for each funnel step and segment if necessary
+WITH ios_onboarding_funnel_new_profile AS (
+  SELECT
+    COALESCE(funnel_id, 'no_onboarding_reported') AS funnel_id,
+    COALESCE(r.repeat_first_month_user, FALSE) AS repeat_first_month_user,
+    COALESCE(r.retained_week_2, FALSE) AS retained_week_2,
+    COALESCE(r.retained_week_4, FALSE) AS retained_week_4,
+    ic.first_reported_country AS country,
+    ic.os_version AS ios_version,
+    ic.channel AS channel,
+    ic.device_model AS device_model,
+    ic.device_manufacturer AS device_manufacturer,
+    ic.first_seen_date AS first_seen_date,
+    ic.adjust_network AS adjust_network,
+    ic.adjust_campaign AS adjust_campaign,
+    ic.adjust_creative AS adjust_creative,
+    ic.adjust_ad_group AS adjust_ad_group,
+    DATE(ic.submission_timestamp) AS submission_date,
+    ic.client_id AS client_id_column,
+    ic.client_id AS column
+  FROM
+    `moz-fx-data-shared-prod`.firefox_ios.firefox_ios_clients AS ic --each client_id has only one row
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_4_v1 AS r --each client_id has only one row
+    USING (client_id)
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_2_v1 AS r2 -- retained_week_2 is not included in funnel_retention_clients_week_4_v1
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        *,
+        client_info.client_id,
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested` AS eu
+      WHERE
+        DATE(submission_timestamp) = @submission_date
+    ) eu
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        client_info.client_id,
+        ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')) AS funnel_id,
+        1 + LENGTH(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id'))) - LENGTH(
+          REPLACE(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')), '_', '')
+        ) AS number_of_onboarding_cards
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested`
+      WHERE
+        `mozfun.map.get_key`(event_extra, 'sequence_id') IS NOT NULL
+        AND DATE(submission_timestamp) = @submission_date
+      GROUP BY
+        client_info.client_id
+    ) AS funnel_ids
+    USING (client_id)
+  WHERE
+    DATE(ic.submission_timestamp) = @submission_date
+),
+ios_onboarding_funnel_first_card_impression AS (
+  SELECT
+    COALESCE(funnel_id, 'no_onboarding_reported') AS funnel_id,
+    COALESCE(r.repeat_first_month_user, FALSE) AS repeat_first_month_user,
+    COALESCE(r.retained_week_2, FALSE) AS retained_week_2,
+    COALESCE(r.retained_week_4, FALSE) AS retained_week_4,
+    ic.first_reported_country AS country,
+    ic.os_version AS ios_version,
+    ic.channel AS channel,
+    ic.device_model AS device_model,
+    ic.device_manufacturer AS device_manufacturer,
+    ic.first_seen_date AS first_seen_date,
+    ic.adjust_network AS adjust_network,
+    ic.adjust_campaign AS adjust_campaign,
+    ic.adjust_creative AS adjust_creative,
+    ic.adjust_ad_group AS adjust_ad_group,
+    DATE(ic.submission_timestamp) AS submission_date,
+    ic.client_id AS client_id_column,
+    CASE
+      WHEN `mozfun.map.get_key`(event_extra, 'sequence_position') = '1'
+        AND event_name = 'card_view'
+        AND event_category = 'onboarding'
+        THEN ic.client_id
+    END AS column
+  FROM
+    `moz-fx-data-shared-prod`.firefox_ios.firefox_ios_clients AS ic --each client_id has only one row
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_4_v1 AS r --each client_id has only one row
+    USING (client_id)
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_2_v1 AS r2 -- retained_week_2 is not included in funnel_retention_clients_week_4_v1
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        *,
+        client_info.client_id,
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested` AS eu
+      WHERE
+        DATE(submission_timestamp) = @submission_date
+    ) eu
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        client_info.client_id,
+        ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')) AS funnel_id,
+        1 + LENGTH(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id'))) - LENGTH(
+          REPLACE(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')), '_', '')
+        ) AS number_of_onboarding_cards
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested`
+      WHERE
+        `mozfun.map.get_key`(event_extra, 'sequence_id') IS NOT NULL
+        AND DATE(submission_timestamp) = @submission_date
+      GROUP BY
+        client_info.client_id
+    ) AS funnel_ids
+    USING (client_id)
+  WHERE
+    DATE(ic.submission_timestamp) = @submission_date
+),
+ios_onboarding_funnel_first_card_primary_click AS (
+  SELECT
+    COALESCE(funnel_id, 'no_onboarding_reported') AS funnel_id,
+    COALESCE(r.repeat_first_month_user, FALSE) AS repeat_first_month_user,
+    COALESCE(r.retained_week_2, FALSE) AS retained_week_2,
+    COALESCE(r.retained_week_4, FALSE) AS retained_week_4,
+    ic.first_reported_country AS country,
+    ic.os_version AS ios_version,
+    ic.channel AS channel,
+    ic.device_model AS device_model,
+    ic.device_manufacturer AS device_manufacturer,
+    ic.first_seen_date AS first_seen_date,
+    ic.adjust_network AS adjust_network,
+    ic.adjust_campaign AS adjust_campaign,
+    ic.adjust_creative AS adjust_creative,
+    ic.adjust_ad_group AS adjust_ad_group,
+    DATE(ic.submission_timestamp) AS submission_date,
+    ic.client_id AS client_id_column,
+    CASE
+      WHEN `mozfun.map.get_key`(event_extra, 'sequence_position') = '1'
+        AND event_name = 'primary_button_tap'
+        AND event_category = 'onboarding'
+        THEN ic.client_id
+    END AS column
+  FROM
+    `moz-fx-data-shared-prod`.firefox_ios.firefox_ios_clients AS ic --each client_id has only one row
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_4_v1 AS r --each client_id has only one row
+    USING (client_id)
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_2_v1 AS r2 -- retained_week_2 is not included in funnel_retention_clients_week_4_v1
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        *,
+        client_info.client_id,
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested` AS eu
+      WHERE
+        DATE(submission_timestamp) = @submission_date
+    ) eu
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        client_info.client_id,
+        ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')) AS funnel_id,
+        1 + LENGTH(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id'))) - LENGTH(
+          REPLACE(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')), '_', '')
+        ) AS number_of_onboarding_cards
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested`
+      WHERE
+        `mozfun.map.get_key`(event_extra, 'sequence_id') IS NOT NULL
+        AND DATE(submission_timestamp) = @submission_date
+      GROUP BY
+        client_info.client_id
+    ) AS funnel_ids
+    USING (client_id)
+  WHERE
+    DATE(ic.submission_timestamp) = @submission_date
+),
+ios_onboarding_funnel_first_card_secondary_click AS (
+  SELECT
+    COALESCE(funnel_id, 'no_onboarding_reported') AS funnel_id,
+    COALESCE(r.repeat_first_month_user, FALSE) AS repeat_first_month_user,
+    COALESCE(r.retained_week_2, FALSE) AS retained_week_2,
+    COALESCE(r.retained_week_4, FALSE) AS retained_week_4,
+    ic.first_reported_country AS country,
+    ic.os_version AS ios_version,
+    ic.channel AS channel,
+    ic.device_model AS device_model,
+    ic.device_manufacturer AS device_manufacturer,
+    ic.first_seen_date AS first_seen_date,
+    ic.adjust_network AS adjust_network,
+    ic.adjust_campaign AS adjust_campaign,
+    ic.adjust_creative AS adjust_creative,
+    ic.adjust_ad_group AS adjust_ad_group,
+    DATE(ic.submission_timestamp) AS submission_date,
+    ic.client_id AS client_id_column,
+    CASE
+      WHEN `mozfun.map.get_key`(event_extra, 'sequence_position') = '1'
+        AND event_name = 'secondary_button_tap'
+        AND event_category = 'onboarding'
+        THEN ic.client_id
+    END AS column
+  FROM
+    `moz-fx-data-shared-prod`.firefox_ios.firefox_ios_clients AS ic --each client_id has only one row
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_4_v1 AS r --each client_id has only one row
+    USING (client_id)
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_2_v1 AS r2 -- retained_week_2 is not included in funnel_retention_clients_week_4_v1
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        *,
+        client_info.client_id,
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested` AS eu
+      WHERE
+        DATE(submission_timestamp) = @submission_date
+    ) eu
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        client_info.client_id,
+        ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')) AS funnel_id,
+        1 + LENGTH(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id'))) - LENGTH(
+          REPLACE(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')), '_', '')
+        ) AS number_of_onboarding_cards
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested`
+      WHERE
+        `mozfun.map.get_key`(event_extra, 'sequence_id') IS NOT NULL
+        AND DATE(submission_timestamp) = @submission_date
+      GROUP BY
+        client_info.client_id
+    ) AS funnel_ids
+    USING (client_id)
+  WHERE
+    DATE(ic.submission_timestamp) = @submission_date
+),
+ios_onboarding_funnel_first_card_close_click AS (
+  SELECT
+    COALESCE(funnel_id, 'no_onboarding_reported') AS funnel_id,
+    COALESCE(r.repeat_first_month_user, FALSE) AS repeat_first_month_user,
+    COALESCE(r.retained_week_2, FALSE) AS retained_week_2,
+    COALESCE(r.retained_week_4, FALSE) AS retained_week_4,
+    ic.first_reported_country AS country,
+    ic.os_version AS ios_version,
+    ic.channel AS channel,
+    ic.device_model AS device_model,
+    ic.device_manufacturer AS device_manufacturer,
+    ic.first_seen_date AS first_seen_date,
+    ic.adjust_network AS adjust_network,
+    ic.adjust_campaign AS adjust_campaign,
+    ic.adjust_creative AS adjust_creative,
+    ic.adjust_ad_group AS adjust_ad_group,
+    DATE(ic.submission_timestamp) AS submission_date,
+    ic.client_id AS client_id_column,
+    CASE
+      WHEN `mozfun.map.get_key`(event_extra, 'sequence_position') = '1'
+        AND event_name = 'close_tap'
+        AND event_category = 'onboarding'
+        THEN ic.client_id
+    END AS column
+  FROM
+    `moz-fx-data-shared-prod`.firefox_ios.firefox_ios_clients AS ic --each client_id has only one row
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_4_v1 AS r --each client_id has only one row
+    USING (client_id)
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_2_v1 AS r2 -- retained_week_2 is not included in funnel_retention_clients_week_4_v1
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        *,
+        client_info.client_id,
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested` AS eu
+      WHERE
+        DATE(submission_timestamp) = @submission_date
+    ) eu
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        client_info.client_id,
+        ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')) AS funnel_id,
+        1 + LENGTH(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id'))) - LENGTH(
+          REPLACE(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')), '_', '')
+        ) AS number_of_onboarding_cards
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested`
+      WHERE
+        `mozfun.map.get_key`(event_extra, 'sequence_id') IS NOT NULL
+        AND DATE(submission_timestamp) = @submission_date
+      GROUP BY
+        client_info.client_id
+    ) AS funnel_ids
+    USING (client_id)
+  WHERE
+    DATE(ic.submission_timestamp) = @submission_date
+),
+ios_onboarding_funnel_second_card_impression AS (
+  SELECT
+    COALESCE(funnel_id, 'no_onboarding_reported') AS funnel_id,
+    COALESCE(r.repeat_first_month_user, FALSE) AS repeat_first_month_user,
+    COALESCE(r.retained_week_2, FALSE) AS retained_week_2,
+    COALESCE(r.retained_week_4, FALSE) AS retained_week_4,
+    ic.first_reported_country AS country,
+    ic.os_version AS ios_version,
+    ic.channel AS channel,
+    ic.device_model AS device_model,
+    ic.device_manufacturer AS device_manufacturer,
+    ic.first_seen_date AS first_seen_date,
+    ic.adjust_network AS adjust_network,
+    ic.adjust_campaign AS adjust_campaign,
+    ic.adjust_creative AS adjust_creative,
+    ic.adjust_ad_group AS adjust_ad_group,
+    DATE(ic.submission_timestamp) AS submission_date,
+    ic.client_id AS client_id_column,
+    CASE
+      WHEN `mozfun.map.get_key`(event_extra, 'sequence_position') = '2'
+        AND event_name = 'card_view'
+        AND event_category = 'onboarding'
+        THEN ic.client_id
+    END AS column
+  FROM
+    `moz-fx-data-shared-prod`.firefox_ios.firefox_ios_clients AS ic --each client_id has only one row
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_4_v1 AS r --each client_id has only one row
+    USING (client_id)
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_2_v1 AS r2 -- retained_week_2 is not included in funnel_retention_clients_week_4_v1
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        *,
+        client_info.client_id,
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested` AS eu
+      WHERE
+        DATE(submission_timestamp) = @submission_date
+    ) eu
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        client_info.client_id,
+        ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')) AS funnel_id,
+        1 + LENGTH(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id'))) - LENGTH(
+          REPLACE(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')), '_', '')
+        ) AS number_of_onboarding_cards
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested`
+      WHERE
+        `mozfun.map.get_key`(event_extra, 'sequence_id') IS NOT NULL
+        AND DATE(submission_timestamp) = @submission_date
+      GROUP BY
+        client_info.client_id
+    ) AS funnel_ids
+    USING (client_id)
+  WHERE
+    DATE(ic.submission_timestamp) = @submission_date
+),
+ios_onboarding_funnel_second_card_primary_click AS (
+  SELECT
+    COALESCE(funnel_id, 'no_onboarding_reported') AS funnel_id,
+    COALESCE(r.repeat_first_month_user, FALSE) AS repeat_first_month_user,
+    COALESCE(r.retained_week_2, FALSE) AS retained_week_2,
+    COALESCE(r.retained_week_4, FALSE) AS retained_week_4,
+    ic.first_reported_country AS country,
+    ic.os_version AS ios_version,
+    ic.channel AS channel,
+    ic.device_model AS device_model,
+    ic.device_manufacturer AS device_manufacturer,
+    ic.first_seen_date AS first_seen_date,
+    ic.adjust_network AS adjust_network,
+    ic.adjust_campaign AS adjust_campaign,
+    ic.adjust_creative AS adjust_creative,
+    ic.adjust_ad_group AS adjust_ad_group,
+    DATE(ic.submission_timestamp) AS submission_date,
+    ic.client_id AS client_id_column,
+    CASE
+      WHEN `mozfun.map.get_key`(event_extra, 'sequence_position') = '2'
+        AND event_name = 'primary_button_tap'
+        AND event_category = 'onboarding'
+        THEN ic.client_id
+    END AS column
+  FROM
+    `moz-fx-data-shared-prod`.firefox_ios.firefox_ios_clients AS ic --each client_id has only one row
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_4_v1 AS r --each client_id has only one row
+    USING (client_id)
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_2_v1 AS r2 -- retained_week_2 is not included in funnel_retention_clients_week_4_v1
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        *,
+        client_info.client_id,
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested` AS eu
+      WHERE
+        DATE(submission_timestamp) = @submission_date
+    ) eu
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        client_info.client_id,
+        ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')) AS funnel_id,
+        1 + LENGTH(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id'))) - LENGTH(
+          REPLACE(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')), '_', '')
+        ) AS number_of_onboarding_cards
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested`
+      WHERE
+        `mozfun.map.get_key`(event_extra, 'sequence_id') IS NOT NULL
+        AND DATE(submission_timestamp) = @submission_date
+      GROUP BY
+        client_info.client_id
+    ) AS funnel_ids
+    USING (client_id)
+  WHERE
+    DATE(ic.submission_timestamp) = @submission_date
+),
+ios_onboarding_funnel_second_card_secondary_click AS (
+  SELECT
+    COALESCE(funnel_id, 'no_onboarding_reported') AS funnel_id,
+    COALESCE(r.repeat_first_month_user, FALSE) AS repeat_first_month_user,
+    COALESCE(r.retained_week_2, FALSE) AS retained_week_2,
+    COALESCE(r.retained_week_4, FALSE) AS retained_week_4,
+    ic.first_reported_country AS country,
+    ic.os_version AS ios_version,
+    ic.channel AS channel,
+    ic.device_model AS device_model,
+    ic.device_manufacturer AS device_manufacturer,
+    ic.first_seen_date AS first_seen_date,
+    ic.adjust_network AS adjust_network,
+    ic.adjust_campaign AS adjust_campaign,
+    ic.adjust_creative AS adjust_creative,
+    ic.adjust_ad_group AS adjust_ad_group,
+    DATE(ic.submission_timestamp) AS submission_date,
+    ic.client_id AS client_id_column,
+    CASE
+      WHEN `mozfun.map.get_key`(event_extra, 'sequence_position') = '2'
+        AND event_name = 'secondary_button_tap'
+        AND event_category = 'onboarding'
+        THEN ic.client_id
+    END AS column
+  FROM
+    `moz-fx-data-shared-prod`.firefox_ios.firefox_ios_clients AS ic --each client_id has only one row
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_4_v1 AS r --each client_id has only one row
+    USING (client_id)
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_2_v1 AS r2 -- retained_week_2 is not included in funnel_retention_clients_week_4_v1
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        *,
+        client_info.client_id,
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested` AS eu
+      WHERE
+        DATE(submission_timestamp) = @submission_date
+    ) eu
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        client_info.client_id,
+        ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')) AS funnel_id,
+        1 + LENGTH(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id'))) - LENGTH(
+          REPLACE(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')), '_', '')
+        ) AS number_of_onboarding_cards
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested`
+      WHERE
+        `mozfun.map.get_key`(event_extra, 'sequence_id') IS NOT NULL
+        AND DATE(submission_timestamp) = @submission_date
+      GROUP BY
+        client_info.client_id
+    ) AS funnel_ids
+    USING (client_id)
+  WHERE
+    DATE(ic.submission_timestamp) = @submission_date
+),
+ios_onboarding_funnel_second_card_close_click AS (
+  SELECT
+    COALESCE(funnel_id, 'no_onboarding_reported') AS funnel_id,
+    COALESCE(r.repeat_first_month_user, FALSE) AS repeat_first_month_user,
+    COALESCE(r.retained_week_2, FALSE) AS retained_week_2,
+    COALESCE(r.retained_week_4, FALSE) AS retained_week_4,
+    ic.first_reported_country AS country,
+    ic.os_version AS ios_version,
+    ic.channel AS channel,
+    ic.device_model AS device_model,
+    ic.device_manufacturer AS device_manufacturer,
+    ic.first_seen_date AS first_seen_date,
+    ic.adjust_network AS adjust_network,
+    ic.adjust_campaign AS adjust_campaign,
+    ic.adjust_creative AS adjust_creative,
+    ic.adjust_ad_group AS adjust_ad_group,
+    DATE(ic.submission_timestamp) AS submission_date,
+    ic.client_id AS client_id_column,
+    CASE
+      WHEN `mozfun.map.get_key`(event_extra, 'sequence_position') = '2'
+        AND event_name = 'close_tap'
+        AND event_category = 'onboarding'
+        THEN ic.client_id
+    END AS column
+  FROM
+    `moz-fx-data-shared-prod`.firefox_ios.firefox_ios_clients AS ic --each client_id has only one row
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_4_v1 AS r --each client_id has only one row
+    USING (client_id)
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_2_v1 AS r2 -- retained_week_2 is not included in funnel_retention_clients_week_4_v1
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        *,
+        client_info.client_id,
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested` AS eu
+      WHERE
+        DATE(submission_timestamp) = @submission_date
+    ) eu
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        client_info.client_id,
+        ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')) AS funnel_id,
+        1 + LENGTH(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id'))) - LENGTH(
+          REPLACE(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')), '_', '')
+        ) AS number_of_onboarding_cards
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested`
+      WHERE
+        `mozfun.map.get_key`(event_extra, 'sequence_id') IS NOT NULL
+        AND DATE(submission_timestamp) = @submission_date
+      GROUP BY
+        client_info.client_id
+    ) AS funnel_ids
+    USING (client_id)
+  WHERE
+    DATE(ic.submission_timestamp) = @submission_date
+),
+ios_onboarding_funnel_third_card_impression AS (
+  SELECT
+    COALESCE(funnel_id, 'no_onboarding_reported') AS funnel_id,
+    COALESCE(r.repeat_first_month_user, FALSE) AS repeat_first_month_user,
+    COALESCE(r.retained_week_2, FALSE) AS retained_week_2,
+    COALESCE(r.retained_week_4, FALSE) AS retained_week_4,
+    ic.first_reported_country AS country,
+    ic.os_version AS ios_version,
+    ic.channel AS channel,
+    ic.device_model AS device_model,
+    ic.device_manufacturer AS device_manufacturer,
+    ic.first_seen_date AS first_seen_date,
+    ic.adjust_network AS adjust_network,
+    ic.adjust_campaign AS adjust_campaign,
+    ic.adjust_creative AS adjust_creative,
+    ic.adjust_ad_group AS adjust_ad_group,
+    DATE(ic.submission_timestamp) AS submission_date,
+    ic.client_id AS client_id_column,
+    CASE
+      WHEN `mozfun.map.get_key`(event_extra, 'sequence_position') = '3'
+        AND event_name = 'card_view'
+        AND event_category = 'onboarding'
+        THEN ic.client_id
+    END AS column
+  FROM
+    `moz-fx-data-shared-prod`.firefox_ios.firefox_ios_clients AS ic --each client_id has only one row
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_4_v1 AS r --each client_id has only one row
+    USING (client_id)
+  LEFT JOIN
+    `moz-fx-data-shared-prod`.firefox_ios_derived.funnel_retention_clients_week_2_v1 AS r2 -- retained_week_2 is not included in funnel_retention_clients_week_4_v1
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        *,
+        client_info.client_id,
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested` AS eu
+      WHERE
+        DATE(submission_timestamp) = @submission_date
+    ) eu
+    USING (client_id)
+  LEFT JOIN
+    (
+      SELECT
+        client_info.client_id,
+        ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')) AS funnel_id,
+        1 + LENGTH(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id'))) - LENGTH(
+          REPLACE(ANY_VALUE(`mozfun.map.get_key`(event_extra, 'sequence_id')), '_', '')
+        ) AS number_of_onboarding_cards
+      FROM
+        `moz-fx-data-shared-prod.firefox_ios.events_unnested`
+      WHERE
+        `mozfun.map.get_key`(event_extra, 'sequence_id') IS NOT NULL
+        AND DATE(submission_timestamp) = @submission_date
+      GROUP BY
+        client_info.client_id
+    ) AS funnel_ids
+    USING (client_id)
+  WHERE
+    DATE(ic.submission_timestamp) = @submission_date
+),
+ios_onboarding_funnel_third_card_primary_click AS (
+  SELECT
+    COALESCE(funnel_id, 'no_onboarding_reported') AS funnel_id,
+    COALESCE(r.repeat_first_month_user, FALSE) AS repeat_first_month_user,
+    COALESCE(r.retained_week_2, FALSE) AS retained_week_2,
+    COALESCE(r.retained_week_4, FALSE) AS retained_week_4,
+    ic.first_reported_country AS country,
+    ic.os_version AS ios_version,
+    ic.channel AS channel,
+    ic.device_model AS device_model,
+    ic.device_manufacturer AS device_manufacturer,
+    ic.first_seen_date AS first_seen_date,
+    ic.adjust_network AS adjust_network,
+    ic.adjust_campaign AS adjust_campaign,
+    ic.adjust_creative AS ad

⚠️ Only part of the diff is displayed.

Link to full diff

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