<script>
function loadXMLDoc(elementId, endpoint) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
document.getElementById(elementId).innerHTML =
this.responseText;
}
};
xhttp.open("GET", endpoint, true);
xhttp.send();
}
</script>
Is there a way to track clicking on an iframe YouTube video? I tried wrapping in the example below, but that doesn’t work. Works great if using normal hyperlinked text, but not here.
I appreciate your help.
<a href="#" onclick="loadXMLDoc('first-element', 'onclick.asp?id=1')"><iframe width="640" height="360" src="https://www.youtube.com/embed/....." frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></a>