unl / wdntemplates

The UNLedu Web Framework (WDN Templates) – Coordinated by the Web Developer Network
https://wdn.unl.edu
35 stars 32 forks source link

Update Google Analytics Tracker for GA4 #1648

Closed tommyneu closed 1 year ago

tommyneu commented 1 year ago

Our current Google Analytics implementation is not using gtag.js. We also need to update code to allow for our events to be sent to our tracker and if other trackers are added theirs needs to be send to them

My initial reaction to the code would be changing analytics.bable.js to use code more similar to gtag('event', '{{ Event Name }}', { 'send_to': '{{ Tracker ID}}' });

We would also need to update ga.js to load gtag.js which is the current google analytics version

Reference links: