Greetings,
I recognize this may fall outside the scope of support here, but my question has to do with how X handles mediaElement.js, which may fall into this realm of support. I’ve been trying to get Google Analytics to fire an event every time someone clicks the Play/Pause button on my site (theegeneration.org).
Here is the code I input into the Global JS:
jQuery(document).ready(function($) {
//Tracking MediaElement Plays
$('body').on('click', '.mejs-play', function() {
ga('send', 'event', 'Audio', 'Play', 'Audio Played');
});
//Tracking MediaElement Pauses
$('body').on('click', '.mejs-pause', function() {
ga('send', 'event', 'Audio', 'Pause', 'Audio Paused');
});
});
Now, as far as I can tell, my code should work, but either my jQuery isn’t finding the on('click')
for some reason or I am goofing up ga()
function somehow.
Is there any insight you can offer me from the standpoint of X that may help me resolve this issue?