caMicroscope
caMicroscope copied to clipboard
Enhance Session Tracking with Unique viewId in Tracker Class
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.
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.