usnistgov / oar-pdr

The NIST Open Access to Research (OAR) Public Data Repository (PDR) system software
11 stars 10 forks source link

Added Google Analytics 4 #315

Closed chuanlin2018 closed 1 year ago

chuanlin2018 commented 1 year ago

http://mml.nist.gov:8080/browse/ODD-1091 This branch added Google Analytics code to PDR.

To test it locally (if you already created an account for SDP testing, it also works for PDR. You can start from step 6),

  1. Login your gmail account
  2. Go to https://analytics.google.com/, click on the "admin" icon at bottom left of the screen
  3. Create a new account.
  4. Add a new Data Streams and set the stream url to http://127.0.0.1 and provide a stream name.
  5. Note MEASUREMENT ID generated by Google Analytics.
  6. Replace src/assets/environment.ts and replace the value of "GA4CODE" with the MEASUREMENT ID got from step 5.
  7. Compile and run PDR by using "npm i" and "npm start" command.
  8. Open http://localhost:4200/od/id/test1
  9. Open https://analytics.google.com/, select the GA account you just generated
  10. Open Google Analytics realtime report, you should see some activites while you interact with the UI such as scroll, click... We still keep the code for GA3.