Conversion Tracking from Analytics.js to Gtag.js - Migration Help

A short tutorial on how to track goals and events with Gtag.js. How to switch from analytics.js to gtag.js

This is a short tutorial on structure of the new gtag to integrate with goal tracking with Google Analytics. 

Before OnClick Events could be tracked like this with Analytics.js

<a onclick="ga('send', 'event', 'btn', 'press', 'call')" href="tel:+16198888888"> (619) 888-8888</a>

Today to Migrate into gtag.js we need to do the following

<a href="tel:+16198888888" onclick="gtag('event', 'call', {'event_category': 'btn', 'event_action' : 'press', 'event_label': 'call'});”>(619) 888-8888</a>

 

Full Documentation on Migration from Analytics.js to gtag.js

https://developers.google.com/analytics/devguides/collection/gtagjs/migration