Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fields:
- name: client_id
mode: NULLABLE
type: STRING
description: "Client ID; uniquely identifies a client. Joinable with fenix.firefox_android_clients."
description: "Client ID; uniquely identifies a client."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the last part since it's joinable with anything on client_id.

- name: sample_id
mode: NULLABLE
type: INTEGER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ SELECT
WHERE
key <= clients_yearly.submission_date
) AS total_historic_ad_clicks,
firefox_android_clients.first_reported_country,
firefox_android_clients.first_reported_isp,
firefox_android_clients.adjust_network,
firefox_android_clients.install_source,
clients.country AS first_reported_country,
CAST(NULL AS STRING) AS first_reported_isp,
clients.adjust_network,
clients.install_source,
FROM
clients_yearly
JOIN
`moz-fx-data-shared-prod.fenix.firefox_android_clients` AS firefox_android_clients
USING (sample_id, client_id)
`moz-fx-data-shared-prod.fenix.new_profile_clients` AS clients
USING (client_id)
LEFT JOIN
`moz-fx-data-shared-prod.fenix.client_adclicks_history`
USING (sample_id, client_id)
WHERE
-- BrowserStack clients are bots, we don't want to accidentally report on them
first_reported_isp != "BrowserStack"
app_name <> "Fenix BrowserStack"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we also be exluding Mozilla Online here @kwindau ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are only excluding BrowserStack due to bots, not due to DAU definitions (this is more LTV focused than DAU focused). I think it's ok to leave as is, thanks for checking

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kwindau one more question, is there a use case where we may want to look at this data and filter out Mozilla Online users?

-- Remove clients who are new on this day, but have more/less than 1 day of activity
AND NOT (days_since_first_seen = 0 AND BIT_COUNT(days_seen_bytes) != 1)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fields:
- name: client_id
mode: NULLABLE
type: STRING
description: "Client ID; uniquely identifies a client. Joinable with fenix.firefox_android_clients."
description: "Client ID; uniquely identifies a client."
- name: sample_id
mode: NULLABLE
type: INTEGER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ SELECT
ac.durations,
ac.ad_clicks,
ac.total_historic_ad_clicks,
c.adjust_network,
c.first_reported_country,
c.first_reported_isp
clients.adjust_network,
clients.country AS first_reported_country,
CAST(NULL AS STRING) AS first_reported_isp,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

isp field no longer available. As far as I recall the only purpose we used it for was to identify bots. This is now done upstream and this filtering can be done via app_name

FROM
ad_clicks ac
JOIN
`moz-fx-data-shared-prod.firefox_ios.firefox_ios_clients` c
USING (sample_id, client_id)
`moz-fx-data-shared-prod.firefox_ios.new_profile_clients` AS clients
USING (client_id)
WHERE
-- BrowserStack clients are bots, we don't want to accidentally report on them
COALESCE(first_reported_isp, '') != "BrowserStack"
app_name <> "Firefox iOS BrowserStack"
-- Remove clients who are new on this day, but have more/less than 1 day of activity
AND NOT (days_since_first_seen = 0 AND BIT_COUNT(days_seen_bytes) != 1)