NIH | National Cancer Institute | NCI Wiki  

Error rendering macro 'rw-search'

null

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

Contents of this Page


EVS Specific

EVS has a shared Google account called ncievsanalytics.  The following applications are being tracked under this account using Universal Analytics (UA).  For EVS, all applications have a connected GA4 property created.

  • EVSExplore
  • NCI Metathesaurus Browser
  • NCI Terms Browser


The EVS Exporter is also located under ncievsanalytics but already uses GA4.

Google Side

Google will automatically create new GA4 properties for all existing UA properties in March 2023. The settings for the UA properties will be copied to the GA4 properties.  If you already created a GA4 property connected to your UA property then nothing will be created by Google. If you have created a GA4 property and discover Google has created another one, it is likely that the previously created GA4 property was never connected to the UA property and it should be deleted.

To check connection go to “Admin” > “Setup Assistant” on the GA4 property.  At the top you should see “Open connected property.”  If this is not present then the GA4 property is not connected to a UA property.  


The “Setup Assistant” page should have a progress bar at the top saying “0/12” setup tasks completed. Much of the tasks deal with advertising and monetization so will be skipped.  Go to the first task “Data collection” and “manage data streams.”  This should show you the application data stream name and code number. 

If these are in place, you can go back to the Setup Assistant and mark the Data collection as complete.  If it tells you “Data Not Flowing”, then you need to check the application and make sure that the analytics header is configured – see Application Side.

  • Further down on the page look at “Define audiences” and make sure there is at least 1.  Review it and see if “All users” is present.
  • Check “Manage users” and see if all appropriate users are listed with the correct level of review – typically “Analyst.”

Now that the Google Analytics web data stream is set up, the app data stream needs to be configured in the application.

Application Side

Many older applications were coded using analytics.js.  GA4, and newer implementations of UA, use gtag.js.  Pages will need to be updated to gtag to enable migration, if they don't use it already.  Once gtag is present, Google should be able to receive data to both UA and GA4, up until UA cutoff date in July. This will allow users to configure GA4 data and reports to match what was received in UA. 

The old analytics.js scripting will look like this and should be removed:

application.js
<head>
…other stuff…

<script>(function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,"script","//www.google-analytics.com/analytics.js","ga");ga("create", "UA-#########", {"cookieDomain":"auto"});ga("send", "pageview");</script>

…other stuff…
</head>

On Google Analytics go to Admin and click the GA4 property for the application that you want to configure. Then click “Data Streams”.  Click the ">" to open the next page.

On the next page, at the top, click “View tag instructions”. 


On the “Installation Instructions” page click “Install Manually”.  The page should then display the text that you need to add to each HTML page in your application. The correct tag ID will already be in the text. You can copy this text and paste it into the web page at the appropriate location, replacing the analytics.js text.



 Once the gtag.js tagged page is deployed to production, data should be visible in GA4 and UA in around 30 minutes.  The UA data will cease collection on July 1, 2023.


  • No labels