add visit duration to tracking events

This commit is contained in:
Michael Czechowski
2024-10-18 11:01:43 +02:00
parent 69c8875309
commit 64e1b0dd55
7 changed files with 21 additions and 14 deletions

View File

@@ -107,3 +107,10 @@ head
)
script(async, defer, data-website-id=head.umamiId, src=head.umamiSrc)
script.
window.visitDuration = Date.now();
const getVisitDuration = () => {
return Math.floor((Date.now() - window.visitDuration) / 1000);
};