I would like to track video plays events. I’m using WP and Elementor. I need to add an event listener but I don’t know what the name of the event I’m looking for is.
Thanks everyone
For now I’ve written this:
<script>
var vid = document.getElementsByClassName("elementor-video");
var myvid= vid[0];
myvid.addEventListener('play', function () {
console.log("video_played");
window.dataLayer.push({
'event': 'video_play'
});
})
<script/>
New contributor
Gloria Galliolo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.