diff --git a/docs/OnTrack/UI Enhancement/Component Reviews/Migrate-analytic-service-CR b/docs/OnTrack/UI Enhancement/Component Reviews/Migrate-analytic-service-CR new file mode 100644 index 000000000..8f6ff465a --- /dev/null +++ b/docs/OnTrack/UI Enhancement/Component Reviews/Migrate-analytic-service-CR @@ -0,0 +1,63 @@ +# OnTrack Component Review + +## Team Member Name +**Zara Danziger** +*Student ID: s223468285* + +## Component Name +**Analytic Services** + +## Files in this Component +- `Analytic-services.Coffee` + +## Component Purpose +The `analytic-service` component is a way to track and log interactions the user has with the application. It collects data from users who have opened it. This service is used for logging different UI interactions and allows tracking of changes to different variables. + +## Screenshot +No Screenshot Needed + +## Component Outcome and Interactions + +### Expected Outcomes: +- Logs UI interactions with event categories, labels, and values. +- Automatically logs changes to scope variables. +- Stops invalid data from being logged. +- Ensures event tracking is only for users who consent. + +### Interactions: +#### Inputs: +- Gets event details including category, event name, label, and value. +- Watches variables for changes to start analytic events. + +#### Outputs: +- Shows an error if an invalid value is detected. +- Sends the analytics to `$analytics.eventTrack`. +- Ensures that the data is only collected from users who have opted in. + +## Component Migration Plan + +### Migration Steps: +1. **Review Existing Component** + - Go over the current component. + - Identify functionalities. + +2. **Set Up Environment** + - Ensure the environment is properly set up and working within the correct branch (9.x). + +3. **Create Component** + - Develop a new component in Angular17 TS. + +4. **Migrate and Downgrade Component** + - Follow the migration guide steps 3 and 4 to downgrade and migrate the component. + +5. **Testing** + - Test the application with the new component on multiple platforms (Google, Safari). + - Fix any issues before committing any changes. + +## Component Checklist +- [ ] Compliance with user consent + - Checks `newUserService.currentUser.optInToResearch` before logging any events. +- [ ] Logs analytic events. +- [ ] Handles data correctly. +- [ ] Handles errors. + - Stops tracking if the component is missing. \ No newline at end of file