Skip to content

Conversation

@Pasindufdo98
Copy link
Contributor

OnTrack Component Review

Team Member Name

Pasindu Fernando

Student ID :

s224263102

Component Name

Analytics Configuration (virtual page views)

Files in this Component

analytics.coffee (to be removed)

Description

The analytics.coffee file was previously responsible for configuring Google Analytics tracking in the AngularJS version of the application. Its key functionality included disabling automatic route change tracking by setting $analyticsProvider.virtualPageviews(false), preventing virtual pageviews from being recorded.

Why Removal is Required

It is no longer functional due to the migration to Angular 17.

All analytics functionality has been migrated to Google Analytics 4 (GA4), which is fully managed through gtag.js in index.html.

Virtual pageviews and event tracking are now handled explicitly using Angular’s Router and manual event tracking with gtag().

How Has This Been Tested?

Monitoring Network Activity (Before and After Removing analytics.coffee): there is no change in the network activity ( Browser developer tools-> network tab-> filter the keyword "google"), before and after removing analytics.coffee since tracking is now fully handled by gtag.js in index.html.

Modifying virtualPageviews to True/False : No visible change in pageview tracking behavior, indicating that analytics.coffee is no longer controlling analytics.

Screenshots

before commenting analytics.coffee file and depenency in config.coffee

before commenting analytics.coffee file and depenency in config.coffee

After commenting analytics.coffee file and depenency in config.coffee
after commenting analytics.coffee file and ddepenency in config.coffee

Testing Checklist:

  • Tested in latest Chrome
  • Tested in latest Safari
  • Tested in latest Firefox

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have requested a review from ... on the Pull Request

Component Migration Plan:

  1. Remove the File:analytics.coffee

  2. Clean Up Dependencies:
    Remove doubtfire.config.analytics from config.coffee.
    Delete any references to angulartics or $analyticsProvider in doubtfire-angularjs.module.ts.

@disururathnayake
Copy link

Make sure to remove the importing line of the old javascript file in doubtfire-angularjs.module.ts. Other than that everything seems good. I approve the component review.

@Pasindufdo98 Pasindufdo98 closed this by deleting the head repository Apr 14, 2025
@atharv02-git
Copy link

atharv02-git commented Apr 15, 2025

Thanks for the component review, had to go through as before reviewing migration it is essential to know about component: what functionality it provides, why removing the file won't create new errors.
LGTM, good work with your component research

@Pasindufdo98
Copy link
Contributor Author

Hi all,
This PR was previously closed due to the accidental deletion of my forked repository. I've now re-forked the repo and re-submitted the same component review in a new PR:

New PR: #605

The content remains the same as reviewed before, and I've included the markdown file with the analytics component explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants