Good morning, right now I'm trying to migrate a bunch of Universal Analytic website events to the including of gtag library.
I'm wondering which would be the correct approach for migrating the current universal analytics click event to be used with gtag library:
onclick="ga('send', 'event', 'Video tutorial links (inside CMS)')"
I was reviewing the Google documentation but I'm not pretty sure about if the below code would be the solution:
gtag('event', 'HowTo', { 'event_categpory' : 'Video tutorial links (inside CMS)' })
Thanks in advance!
With UA:
With GA4:
The order changes a little bit, also notice that
fieldsObjectis gone.You should give your event (that before was only an
eventCategory) also aneventActionto make sense with GA4.