Copy link to clipboard
Copied
Hello all,
Does anyone know how to integrate Google Analytics 4 events in the javascript code for an animate html5 canvas game?
With Universal Analytics, I was able to use a code like "ga('send', 'event', 'Draw', 'ASAD');" within my actions javascript (while also pasting the GA4 code in the header of the html file) to trigger an event. Now with GA4, I have tried using the new format of "gtag('event', 'draw' , { 'gameType' : 'ASAD'});" but I get no event trigger.
All other events on my website are working fine (including the pageview event from the game's html page loading), but there is nothing being reported in my animate games' javascript.
Can anyone help me out here?
Thank you!
Have something to add?