出于某些原因,我们打算停止该功能,并希望了解这会对我们的用户群体产生何种影响。是否有简便的方法可以查明这一点?
There’s some discussion about this here
@david once your work consolidating is done, can you add a quick built-in report to data explorer that counts users per auth method. I think it can help make decisions in some cases.
Definitely
. Once the new stuff is done we will also be able to report on “last used date”, which should be useful for deciding which methods are important.
这些 Data Explorer 查询可以在这些情况下提供帮助。
1. 按 Facebook 登录方式列出的用户列表
WITH target_user_ids AS (
SELECT id
FROM users
WHERE staged = false
AND active = true
AND last_seen_at IS NOT NULL)
SELECT
provider_name,
user_id,
info->>'name' AS name_user,
info->>'email' AS email_user,
info->>'image' AS image_user
FROM user_associated_accounts ua
WHERE user_id IN (SELECT id FROM target_user_ids)
AND provider_name = 'facebook'
| provider_name | user_id | name | image | |
|---|---|---|---|---|
| 1 | User1 | user1@gmail.com | https://graph.facebook.com/.../photo1.jpg | |
| 2 | User2 | user2@yahoo.com | https://graph.facebook.com/.../photo2.jpg |
2. 按外部登录方式列出的用户列表
- discord
- github
- google_oauth2
WITH target_user_ids AS (
SELECT id
FROM users
WHERE staged = false
AND active = true
AND last_seen_at IS NOT NULL)
SELECT
provider_name,
user_id,
info->>'name' AS name,
info->>'email' AS email,
info->>'image' AS image
FROM user_associated_accounts ua
WHERE user_id IN (SELECT id FROM target_user_ids)
| provider_name | user_id | name | image | |
|---|---|---|---|---|
| google_oauth2 | 1 | User1 | user1@gmail.com | https://lh3.googleusercontent.com/.../p1.jpg |
| 2 | User2 | user2@yahoo.com | https://graph.facebook.com/.../p2.jpg | |
| 3 | User3 | user3@gmail.com | http://pbs.twimg.com/profile_img/.../p1.jpg |
3. 按外部登录方式统计的用户数量
WITH target_user_ids AS (
SELECT id
FROM users
WHERE staged = false
AND active = true
AND last_seen_at IS NOT NULL)
SELECT
provider_name,
COUNT(user_id) AS qtd
FROM user_associated_accounts ua
WHERE user_id IN (SELECT id FROM target_user_ids)
GROUP BY provider_name
UNION
SELECT
'github',
COUNT(user_id)
FROM github_user_infos
WHERE user_id IN (SELECT id FROM target_user_ids)
ORDER BY provider_name
| provider_name | qtd |
|---|---|
| discord | 10 |
| 100 | |
| github | 400 |
| google_oauth2 | 500 |
| 200 |
感谢您发布这些查询!2ª 回答了我之前的一个问题。
(关键词提升:列出 oauth 用户,查找 oauth 用户)