Skip to content

Commit

Permalink
Merge pull request #804 from yzhong32/tracker
Browse files Browse the repository at this point in the history
Enhance Session Tracking with Unique viewId in Tracker Class
  • Loading branch information
birm authored Mar 26, 2024
2 parents 7d5df1f + 66c0eee commit fc91c44
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,11 @@ class Tracker {
this.__period = period;
this.__userId = userId;
this.__slide = slide;
this.__viewId = this.generateViewId();
}

generateViewId() {
return crypto.randomUUID();
}
start() {
if (!this.__time) {
Expand All @@ -1064,6 +1069,7 @@ class Tracker {
);

this.__camic.store.addLog({
viewId: this.__viewId,
slide: this.__slide,
user: this.__userId,
x: Math.round(x),
Expand Down

0 comments on commit fc91c44

Please sign in to comment.