Skip to content

Commit af38a2f

Browse files
committed
add conversion rate
1 parent 8c443b6 commit af38a2f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
TOKEN "read" READ
2+
3+
NODE get_conversion
4+
SQL >
5+
6+
SELECT
7+
count(DISTINCT signups.user_id) as new_signups,
8+
count(DISTINCT logins.user_id) as active_new_users,
9+
ROUND(
10+
count(DISTINCT logins.user_id) / count(DISTINCT signups.user_id) * 100, 1
11+
) as conversion_rate
12+
FROM
13+
(
14+
SELECT event.data.user_id as user_id
15+
FROM auth0
16+
WHERE event_type = 'ss' AND event_time >= now() - interval 30 days
17+
) signups
18+
LEFT JOIN
19+
(
20+
SELECT event.data.user_id as user_id
21+
FROM auth0
22+
WHERE event_type = 'sl' AND event_time >= now() - interval 30 days
23+
) logins
24+
ON signups.user_id = logins.user_id

0 commit comments

Comments
 (0)