caMicroscope icon indicating copy to clipboard operation
caMicroscope copied to clipboard

Enhance Session Tracking with Unique viewId in Tracker Class

Open yzhong32 opened this issue 3 months ago • 0 comments

Summary

This update introduces a 'viewId' field to the Tracker class, ensuring each session is uniquely identifiable. The 'viewId' is generated using crypto.randomUUID() at the start of each session and is incorporated into all related log entries. This enhancement facilitates more accurate session tracking and analysis.

Motivation

The introduction of the viewId field addresses the need for precise session identification and improves the efficiency of data querying and aggregation. For example, with viewId, leveraging MongoDB's aggregation capabilities to determine the start and end times of individual view sessions becomes straightforward. Screenshot 2024-03-19 at 1 21 22 AM

Additionally, the introduction of the 'viewId' field lays a solid foundation for future enhancements to the logging system, such as tracking user annotation behaviors.

Testing

The addition of the 'viewId' field to the log collection has been tested. Screenshot 2024-03-19 at 1 23 18 AM

Questions

yzhong32 avatar Mar 19 '24 06:03 yzhong32