If you want to push special event to Google Analytics, you can use this piece of code and just change eventCategory, eventAction, eventLabel and eventValue values.
dataLayer.push({
'event':'wasCustomEvent',
'wasCustomEventData': {
'eventName':'w_contact_submitted', // GA4 event name - max. 40 characters (use only lowercase and underscore)
'eventCategory':'Form Submit',
'eventAction':'Contact',
'eventLabel':formProduct,
'eventValue': 0
},
'eventCallback' : function() {
dataLayer.push({'wasCustomEventData': undefined });
}
});
This website is a demo/test website for Advanced Web Analytics Setup Bundle.
GTM used on this website is GTM-PZZP5RR
Save 30+ hours of struggling with setup and coding.