I noticed some of my event tracking wasn’t showing up in Google Analytics. I recently had the same problem and it was related to using the legacy ga.js library and moving to the newer analytics.js library. However, I just found out there is a even newer library based on gtag.js. So, I did some research and found a migration document.
Here is a sample of my current code for an onclick attribute:
“ga(‘send’, ‘event’,’Reviews’, ‘Facebook-5’)”
Here is the updated code:
“gtag(‘event’, ‘click’, {‘event_category’: ‘Reviews’,’event_label’: ‘Facebook-5’});”
References