Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1628fb0
Pull country from metrics in quick_suggest ping
curtismorales May 23, 2025
68e8fc9
Fix queries
curtismorales Jul 1, 2025
c2a1c8a
Fix tests
curtismorales Jul 1, 2025
b5c8597
Merge branch 'main' into AD-869-update-suggest-derived-tables
curtismorales Jul 1, 2025
61fad86
Merge branch 'main' into AD-869-update-suggest-derived-tables
curtismorales Jul 9, 2025
8bb47a9
Update suggest_impression_sanitized_v3 test
curtismorales Jul 9, 2025
00cc357
Merge branch 'AD-869-update-suggest-derived-tables' of github.com:moz…
curtismorales Jul 9, 2025
06f8a94
Merge branch 'main' into AD-869-update-suggest-derived-tables
curtismorales Jul 9, 2025
d171488
update CODEOWNERS
curtismorales Jul 9, 2025
01f5dc3
Fix cast
curtismorales Jul 9, 2025
66e4d14
Merge branch 'main' into AD-869-update-suggest-derived-tables
curtismorales Jul 9, 2025
6d2d8ad
Update codeowners
curtismorales Jul 9, 2025
e3a72cd
Merge branch 'AD-869-update-suggest-derived-tables' of github.com:moz…
curtismorales Jul 9, 2025
c883dba
Undo changes to CODEOWNERS
curtismorales Jul 9, 2025
2ac9381
Test CI codeowners check
curtismorales Jul 9, 2025
95c218b
Merge branch 'main' into AD-869-update-suggest-derived-tables
curtismorales Jul 11, 2025
bccfc94
Undo change
curtismorales Jul 11, 2025
c513324
Merge branch 'AD-869-update-suggest-derived-tables' of github.com:moz…
curtismorales Jul 11, 2025
1779e5c
Merge branch 'main' into AD-869-update-suggest-derived-tables
curtismorales Jul 14, 2025
8f1fd4c
Merge branch 'main' into AD-869-update-suggest-derived-tables
curtismorales Jul 14, 2025
7c5c81f
Merge branch 'main' into AD-869-update-suggest-derived-tables
curtismorales Aug 7, 2025
ee2e3a5
Merge branch 'main' into AD-869-update-suggest-derived-tables
curtismorales Aug 19, 2025
7d45317
Simplify logic: just fall back to metrics.string.quick_suggest_country
curtismorales Aug 21, 2025
8ae4212
Merge branch 'AD-869-update-suggest-derived-tables' of github.com:moz…
curtismorales Aug 21, 2025
074014e
Remove country_ip and country_browser fields
curtismorales Aug 21, 2025
99c7bc9
Remove unneeded version
curtismorales Aug 21, 2025
cdd7c75
Fix tests
curtismorales Aug 22, 2025
6ba5688
Fix CODEOWNERS
curtismorales Aug 27, 2025
f1fcb9e
Merge branch 'main' into AD-869-update-suggest-derived-tables
curtismorales Aug 27, 2025
5d76e6b
Merge branch 'main' into AD-869-update-suggest-derived-tables
curtismorales Aug 27, 2025
72f84b7
Remove change to request_payload_suggest_v2
curtismorales Aug 27, 2025
a84ab1e
Revert "Remove change to request_payload_suggest_v2"
curtismorales Aug 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dags.yaml
/sql/moz-fx-data-shared-prod/search_derived/search_revenue_levers_daily_v1/ @mozilla/revenue_forecasting_data_reviewers
/sql/moz-fx-data-shared-prod/search_derived/search_dau_aggregates_v1/ @mozilla/revenue_forecasting_data_reviewers
# Contextual Services
/sql/moz-fx-data-shared-prod/contextual_services_derived/request_payload_suggest_v2 @mozilla/request_payload_reviewers
/sql/**/request_payload_suggest_v2 @mozilla/request_payload_reviewers
/sql/moz-fx-data-shared-prod/contextual_services_derived/request_payload_tiles_v2 @mozilla/request_payload_reviewers
/sql/moz-fx-data-shared-prod/contextual_services_derived/suggest_revenue_levers_daily_v1 @mozilla/revenue_forecasting_data_reviewers
/sql/moz-fx-data-shared-prod/monitoring_derived/jobs_by_organization_v1 @mozilla/dataops
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ combined AS (
metrics.uuid.quick_suggest_context_id AS context_id,
DATE(submission_timestamp) AS submission_date,
'desktop' AS form_factor,
normalized_country_code AS country,
-- As of Firefox 141, the quick_suggest ping is sent via OHTTP and now
-- receives geo information from the client rather than from Glean ingestion's
-- IP geolocation. We no longer send subdivision, only country.
COALESCE(normalized_country_code, metrics.string.quick_suggest_country) AS country,
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious if it applies to other tables in the query, e.g. moz-fx-data-shared-prod.fenix.fx_suggest which has a similar field metrics.string.fx_suggest_country.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, made a similar change for Android. This doesn't exist yet for iOS, however.

LOWER(metrics.string.quick_suggest_advertiser) AS advertiser,
SPLIT(metadata.user_agent.os, ' ')[SAFE_OFFSET(0)] AS normalized_os,
client_info.app_channel AS release_channel,
Expand Down Expand Up @@ -102,7 +105,8 @@ combined AS (
metrics.uuid.fx_suggest_context_id AS context_id,
DATE(submission_timestamp) AS submission_date,
'phone' AS form_factor,
normalized_country_code AS country,
-- With shift to OHTTP, we expect to stop receiving normalized_country_code soon
COALESCE(normalized_country_code, metrics.string.fx_suggest_country) AS country,
metrics.string.fx_suggest_advertiser AS advertiser,
SPLIT(metadata.user_agent.os, ' ')[SAFE_OFFSET(0)] AS normalized_os,
client_info.app_channel AS release_channel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ combined AS (
"impression"
) AS event_type,
'desktop' AS form_factor,
normalized_country_code AS country,
-- As of Firefox 141, the quick_suggest ping is sent via OHTTP and now
-- receives geo information from the client rather than from Glean ingestion's
-- IP geolocation. We no longer send subdivision, only country.
COALESCE(normalized_country_code, metrics.string.quick_suggest_country) AS country,
metadata.geo.subdivision1 AS subdivision1,
metrics.string.quick_suggest_advertiser AS advertiser,
client_info.app_channel AS release_channel,
Expand Down Expand Up @@ -117,7 +120,8 @@ combined AS (
"impression"
) AS event_type,
'phone' AS form_factor,
normalized_country_code AS country,
-- With shift to OHTTP, we expect to stop receiving normalized_country_code soon
COALESCE(normalized_country_code, metrics.string.fx_suggest_country) AS country,
metadata.geo.subdivision1 AS subdivision1,
metrics.string.fx_suggest_advertiser AS advertiser,
client_info.app_channel AS release_channel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ ping_data AS (
"click",
"impression"
) AS interaction_type,
metadata.geo.country AS country_code,
-- As of Firefox 141, the quick_suggest ping is sent via OHTTP and now
-- receives geo information from the client rather than from Glean ingestion's
-- IP geolocation. We no longer send subdivision, only country.
COALESCE(metadata.geo.country, metrics.string.quick_suggest_country) AS country,
metadata.geo.subdivision1 AS region_code,
metadata.user_agent.os AS os_family,
metadata.user_agent.version AS product_version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ WITH impressions AS (
sample_id,
metrics.boolean.quick_suggest_is_clicked AS is_clicked,
client_info.locale AS locale,
metadata.geo.country,
-- As of Firefox 141, the quick_suggest ping is sent via OHTTP and now
-- receives geo information from the client rather than from Glean ingestion's
-- IP geolocation. We no longer send subdivision, only country.
COALESCE(metadata.geo.country, metrics.string.quick_suggest_country) AS country,
metadata.geo.subdivision1 AS region,
normalized_os,
normalized_os_version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
submission_date: "2030-01-01"
source: suggest
provider: merino
event_type: impression
event_type: click
form_factor: desktop
country: US
subdivision1: AZ
country: DE
advertiser: ad1
release_channel: release
match_type: "firefox-suggest"
Expand All @@ -17,7 +16,12 @@
user_count: 1
query_type: branded
- <<: *suggest_base
event_type: click
event_type: impression
country: US
subdivision1: AZ
- <<: *suggest_base
country: US
subdivision1: AZ
- &suggest_mobile
submission_date: "2030-01-01"
source: suggest
Expand All @@ -36,6 +40,20 @@
query_type: branded
- <<: *suggest_mobile
normalized_os: iOS
- submission_date: "2030-01-01"
source: suggest
provider: remote settings
event_type: impression
form_factor: phone
country: VN
advertiser: ad4
release_channel: release
match_type: "firefox-suggest"
normalized_os: Android
position: 1
event_count: 1
user_count: 1
query_type: branded
- &topsites_base
submission_date: "2030-01-01"
source: topsites
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
string:
fx_suggest_advertiser: ad4
fx_suggest_ping_type: fxsuggest-impression
fx_suggest_country: null
uuid:
fx_suggest_context_id: fenix-b
metadata:
Expand All @@ -18,6 +19,19 @@
client_info:
app_channel: release
normalized_country_code: US
- <<: *suggest_base
metrics:
<<: *suggest_metrics
string:
fx_suggest_advertiser: ad4
fx_suggest_ping_type: fxsuggest-impression
fx_suggest_country: VN
metadata:
geo:
subdivision1: null
user_agent:
os: Android
normalized_country_code: null
- <<: *suggest_base
metrics:
<<: *suggest_metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,15 @@
string:
<<: *click_strings
quick_suggest_ping_type: quicksuggest-impression
- <<: *click
metadata:
geo:
subdivision1: null
user_agent:
os: "Windows 11"
metrics:
<<: *click_metrics
string:
<<: *click_strings
quick_suggest_country: DE
normalized_country_code: null
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
string:
fx_suggest_advertiser: ad4
fx_suggest_ping_type: fxsuggest-click
fx_suggest_country: null
uuid:
fx_suggest_context_id: fenix-b
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
subdivision1: AZ
user_agent:
os: "Windows 11"
version: 130
metrics: &click_metrics
boolean:
quick_suggest_improve_suggest_experience: true
Expand All @@ -19,6 +20,7 @@
quick_suggest_match_type: firefox-suggest
quick_suggest_ping_type: quicksuggest-click
quick_suggest_request_id: HASH123
quick_suggest_country: null
uuid:
quick_suggest_context_id: a
normalized_country_code: US
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,24 @@
reporting_url: https://example.com/duff-beer
submission_timestamp: "2021-01-01T13:03:00+00:00"
version: "134"
- advertiser: omni consumer products
block_id: 205
browser: firefox(141)
context_id: cid15
country: US
form_factor: desktop
is_clicked: false
locale: en-US
normalized_channel: release
normalized_os: windows
normalized_os_version: 15.2
os_family: windows
position: 15
query: robot police
reporting_url: https://example.com/ocp
request_id: rid15
sequence_no: 15
session_id: sid15
submission_timestamp: "2021-01-01T13:05:00+00:00"
timestamp: "2021-01-01T13:05:00+00:00"
version: "141"
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,30 @@
normalized_os: Windows
normalized_os_version: "11.0"
sample_id: null
- submission_timestamp: "2021-01-01 13:05:00"
client_info:
app_display_version: "141.0.1"
locale: en-US
metadata:
geo:
country: null
subdivision1: null
metrics:
boolean:
quick_suggest_is_clicked: false
quantity:
quick_suggest_position: 15
string:
quick_suggest_advertiser: omni consumer products
quick_suggest_block_id: 205
quick_suggest_ping_type: "quicksuggest-impression"
quick_suggest_request_id: rid15
quick_suggest_country: US
url2:
quick_suggest_reporting_url: "https://example.com/ocp"
uuid:
quick_suggest_context_id: cid15
normalized_channel: release
normalized_os: windows
normalized_os_version: "15.2"
sample_id: null
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,14 @@
form_factor: desktop
browser: firefox(134)
os_family: windows
- timestamp: "2021-01-01 13:05:00.000000"
request_id: rid15
session_id: sid15
sequence_no: 15
query: "robot police"
country: null
region: null
dma: null
form_factor: desktop
browser: firefox(141)
os_family: windows