You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ Since this is not a library, this changelog focuses on the changes that are rele
18
18
19
19
## [Unreleased]
20
20
21
+
- Added new entry/exit page metric
21
22
- Updated to the latest version of DuckDB (1.5.1)
22
23
- Fixed error when both `listen` and `port` configuration options are set
23
24
- Added retry logic when loading the DuckDB database to handle potential locking issues on startup (e.g. when the database is being updated by another process or when using a shared network drive)
// Count the number of unique visitors as the number of distinct visitor IDs
196
206
"--sql
197
207
count(distinct sd.visitor_id)"
208
+
.to_owned()
198
209
}
199
210
Metric::BounceRate => {
200
211
// total sessions: no time_to_next_event / time_to_next_event is null
201
-
// bounce sessions: time to next / time to prev are both null or both > interval '30 minutes'
202
-
"--sql
212
+
// bounce sessions: time to next / time to prev are both null or both > session duration
213
+
format!(
214
+
"--sql
203
215
coalesce(
204
216
count(distinct sd.visitor_id)
205
-
filter (where (sd.time_to_next_event is null or sd.time_to_next_event > interval '30 minutes') and
206
-
(sd.time_from_last_event is null or sd.time_from_last_event > interval '30 minutes')) /
207
-
nullif(count(distinct sd.visitor_id) filter (where sd.time_to_next_event is null or sd.time_to_next_event > interval '30 minutes'), 0),
217
+
filter (where (sd.time_to_next_event is null or sd.time_to_next_event > {SESSION_DURATION_SQL}) and
218
+
(sd.time_from_last_event is null or sd.time_from_last_event > {SESSION_DURATION_SQL})) /
219
+
nullif(count(distinct sd.visitor_id) filter (where sd.time_to_next_event is null or sd.time_to_next_event > {SESSION_DURATION_SQL}), 0),
208
220
1
209
221
)
210
222
"
223
+
)
211
224
}
212
225
Metric::AvgTimeOnSite => {
213
-
// avg time_to_next_event where time_to_next_event <= 1800 and time_to_next_event is not null
214
-
"--sql
215
-
coalesce(avg(extract(epoch from sd.time_to_next_event)) filter (where sd.time_to_next_event is not null and sd.time_to_next_event <= interval '30 minutes'), 0)"
226
+
// avg time_to_next_event where time_to_next_event <= session duration and time_to_next_event is not null
227
+
format!(
228
+
"--sql
229
+
coalesce(avg(extract(epoch from sd.time_to_next_event)) filter (where sd.time_to_next_event is not null and sd.time_to_next_event <= {SESSION_DURATION_SQL}), 0)"
0 commit comments