Answers for "GA Tracking"

1

set up google analytics

How to set up Google analytics:

Watch this video: https://www.youtube.com/watch?v=lZf3YYkIg8w

Or Click on this link: https://support.google.com/analytics/answer/1008015?hl=en
Posted by: Guest on October-16-2020
0

GA Tracking

// Google Analytics Event Button Tracking

// wait till eveythings ready
jQuery(document).ready(function () {
	
	// 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?
		var name = jQuery(this).text();
		
		// assuming Google Analytics is already loaded, fire event log
		ga('send', 'event', 'button', 'click', name);
	});
	
})
Posted by: Guest on June-02-2021

Browse Popular Code Answers by Language