Answer the question
In order to leave comments, you need to log in
How to correctly set a goal in Ya.Metrika on a video in html5?
I try like this, but there is no movement
<video playsinline="playsinline" controls poster="assets/mp4/firstkadr.jpg" onclick="yaCounter50927597.reachGoal('video'); return true;">
<source src="assets/mp4/p720.mp4" type="video/mp4">
</video>
Answer the question
In order to leave comments, you need to log in
I did not find ready-made solutions on the Internet, keep
// Отслеживание завершения просмотра видео
var v = document.getElementsByTagName("video")[0];
v.addEventListener("ended",
function () {
yaCounterXXXXXXXX.reachGoal('video'); return true;
}
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question