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 Multi-Device Explore from Glean activity data #756

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions accounts_backend/accounts_backend.model.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ connection: "telemetry"
label: "Firefox Accounts Backend"
include: "//looker-hub/accounts_backend/explores/*"
# include: "//looker-hub/accounts_backend/dashboards/*"
# include: "views/*"
# include: "explores/*"
include: "views/*"
include: "explores/*"
# include: "dashboards/*"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include: "../views/mozilla_accounts_multi_device_dau.view.lkml"

explore: mozilla_accounts_multi_device_dau {
label: "Multi-Device Mozilla Accounts DAU"

conditionally_filter: {
filters: [date_date: "30 days ago for 30 days"]
unless: [date_week, date_month, date_quarter, date_year]
}

}
52 changes: 52 additions & 0 deletions accounts_backend/views/mozilla_accounts_multi_device_dau.view.lkml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
view: mozilla_accounts_multi_device_dau {
label: "Multi-Device Mozilla Accounts DAU"
derived_table: {

sql:
SELECT
DATE(e.submission_timestamp) as submission_date,
e.metrics.string.account_user_id_sha256 AS user_id,
ARRAY_AGG(DISTINCT CONCAT(e.metadata.user_agent.browser, ' ', e.metadata.user_agent.os, ' ', e.metadata.user_agent.version) IGNORE NULLS ORDER BY CONCAT(e.metadata.user_agent.browser, ' ', e.metadata.user_agent.os, ' ', e.metadata.user_agent.version)) as devices,
FROM
`mozdata.accounts_backend.accounts_events` AS e
WHERE e.metrics.string.event_name like r'access\_token%'
GROUP BY
1, 2
HAVING ARRAY_LENGTH(devices) > 1;;
}

measure: user_count {
type: count_distinct
sql: ${TABLE}.user_id ;;
}

dimension_group: date {
type: time
sql: ${TABLE}.submission_date;;
datatype: date
convert_tz: no
timeframes:[
date,
week,
month,
quarter,
year
]
}

dimension: user_id {
type: string
sql: ${TABLE}.user_id ;;
}

dimension: devices_quantity {
type: number
sql: ARRAY_LENGTH(${TABLE}.devices) ;;
}

dimension: device_names {
type: string
sql: ARRAY_TO_STRING(${TABLE}.devices, ' + ') ;;
}

}