mozilla / bigquery-etl

Bigquery ETL
https://mozilla.github.io/bigquery-etl
Mozilla Public License 2.0
253 stars 100 forks source link

Bug 1899277 - Use ad group ID to get campaign info #5670

Closed fbertsch closed 4 months ago

fbertsch commented 4 months ago

In bug 1899277, we found that the new campaign names are not being fully reported to us - they are truncated at 100 bytes. To work around this, we only pull the Ad Group ID (which is not truncated), and use that to get the campaign ID (a campaign is 1:many with ad groups, so each ad group only has a single associated campaign). We then parse that associated campaign for the segments.

Checklist for reviewer:

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

dataops-ci-bot commented 4 months ago

Integration report for "Use ad group ID to get campaign info"

sql.diff

Click to expand! ```diff diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/google_ads_derived/android_app_campaign_stats_v1/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/google_ads_derived/android_app_campaign_stats_v1/query.sql --- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/google_ads_derived/android_app_campaign_stats_v1/query.sql 2024-05-28 20:48:26.000000000 +0000 +++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/google_ads_derived/android_app_campaign_stats_v1/query.sql 2024-05-28 20:48:33.000000000 +0000 @@ -95,8 +95,8 @@ FROM by_ad_group_id JOIN - `moz-fx-data-shared-prod`.google_ads_derived.campaigns_v2 - USING (campaign_id) -JOIN `moz-fx-data-shared-prod`.google_ads_derived.ad_groups_v1 - USING (campaign_id, ad_group_id) + USING (ad_group_id) +JOIN + `moz-fx-data-shared-prod`.google_ads_derived.campaigns_v2 + ON ad_groups_v1.campaign_id = campaigns_v2.campaign_id ```

Link to full diff