Last active
September 27, 2019 04:17
-
-
Save sparkalow/4d2ef853bb93862f9a46 to your computer and use it in GitHub Desktop.
jQuery Google Analytics Events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('[data-ga-event]').on('click',function (event ) { | |
var $el = $(this); | |
var category = $el.data('ga-event'), | |
action =$el.data('ga-action'), | |
label = $el.data('ga-label'); | |
ga('send', 'event', category, action, label); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment