// use whatever selectors you want to track, e.g. "a.trackMe"
jQuery('.gaTrack, button, a.button, input[type="submit"], input[type="button"], input[type="reset"], .wp-block-button__link, .menu-item a, .menu a, li a').on('click',function(){
// what was clicked?
varname=jQuery(this).text();
// assuming Google Analytics is already loaded, fire event log
This comment has been minimized.
hi,
Just a quick question if using gtag.js should the event be written like this:
gtag('event','click'{'event_category':'button', 'event_label':name});
instead of
ga('send', 'event', 'button', 'click', name);
Thanks,
Rob